Reputation: 6063
I want to replace word
with WORD
, but only on the lines which start with -
. Anybody knows how to do it?
Upvotes: 9
Views: 3520
Reputation: 89053
:%g/^-/s/word/WORD/g
it's just a normal search and replace, but using g// to filter the lines you want to run it on.
Upvotes: 13