Remove Duplicate Line in Vim?

后端 未结 9 1173
有刺的猬
有刺的猬 2021-01-15 06:19

I\'m trying to use VIM to remove a duplicate line in an XML file I created. (I can\'t recreate the file because the ID numbers will change.)

The file looks something

9条回答
  •  猫巷女王i
    2021-01-15 06:47

    Are you trying to search and replace the line with nothing? You could try the g command instead:

    :%g/search_expression_here/d
    

    The d at the end tells it to delete the lines that match.

    You may find more tips here.

提交回复
热议问题