Delete first word of each line

前端 未结 7 2159
耶瑟儿~
耶瑟儿~ 2021-02-01 16:45

How do I delete first word of each line in Vim?

How about a pattern on each line?

7条回答
  •  甜味超标
    2021-02-01 17:34

    Although this is an old question, if someone else is looking to do this you could do use visual block.

    • press ctrl+v
    • select all the lines you would want to edit
    • now use arrow keys to select the entire word
    • press 'x'

    That would delete the first word in all the lines. This method is especially very handy to edit log files

提交回复
热议问题