How do I delete first word of each line in Vim?
How about a pattern on each line?
Ctrl + U = Delete left of the cursor. Ctrl + K = Delete right of the cursor. Ctrl + W = Delete word on the left.
Re: Remove First "Word" And Whitespace At Beginning Of Each Make sure you have the multi-line anchor option set correctly. Another way of doing this is using the Text FX function to delete the first word of Notepad++.
: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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With