Delete first word of each line

前端 未结 7 2058
耶瑟儿~
耶瑟儿~ 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:28

    First word (where word is defined as no whitespace)

    :%s/^\s*[^ ]* //g
    

    Delete pattern:

    :%s/< insert pattern here >//g
    

提交回复
热议问题