Delete first word of each line

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

    :normal to the rescue:

    :%norm dw
    

    It basically replays the arguments as if you were typing them in normal ('non-edit') mode.

    From :help :

    :norm[al][!] {commands}

    Execute Normal mode commands {commands}.

    This makes it possible to execute Normal mode commands typed on the command-line. {commands} is executed like it is typed.

提交回复
热议问题