Globally append to line with matching term in vim

后端 未结 3 872
萌比男神i
萌比男神i 2021-02-04 04:50

I am sure this is easy, I am just missing a character or two.

I need to search for a particular term in a file, and when I find it, I need to append something to that

3条回答
  •  故里飘歌
    2021-02-04 05:06

    The :g// command is what you're looking for — it runs a command on each line matching a pattern:

    :g/Thing to find/ s/$/ Stuff to append/
    

提交回复
热议问题