r/ProgrammerHumor • • Apr 20 '15

vim

Post image
1.3k Upvotes

427 comments sorted by

View all comments

Show parent comments

3

u/pehnn_altura Apr 21 '15

:%s/foo/bar/g

Find and replace all instances of foo with bar. Great shortcut if you need to rename a variable!

0

u/[deleted] Apr 21 '15

[deleted]

1

u/Sean1708 Apr 21 '15

What of you mean by a proper structural scan?

2

u/minno Apr 21 '15

Instead of replacing every instance of an "f" followed by an "o" and then another "o", it finds the declaration of the variable you ask it to rename and finds every use point of that variable, so other variables or program fragments that match the same string don't get replaced.

→ More replies (3)