linux - Vim, find the n'th occurence of a word -
i tried using following syntax, in vim find n'th occurence of word(i replace word one)
:6:myword
and replace newword
i not understand getting wrong, can me?
s/\%(\(myword\).\{-}\)\{6}\zs\1/newword/ ^ ^ ^ pattern occurrence replace pattern
it replace 6th occurrence of myword newword.
Comments
Post a Comment