-
Notifications
You must be signed in to change notification settings - Fork 7
Useful vim tricks
Louis Maddox edited this page Feb 10, 2021
·
2 revisions
-
Chain
:wn
after another ex command in vim with|
to "move on to the next file" (and just repeat the same thing), e.g. to do a replace all and move on:echo "hello world" > a.txt echo "hello? world?" > b.txt echo "helloooo world" > c.txt vim {a,b,c}.txt
⇣
:%s/o/a/g | wn
You might combine this with grep to find the files with the matching string:
vim $(grep -r "o" | cut -d ":" -f 1 | sort | uniq)