Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete first word of each line

Tags:

vim

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

How about a pattern on each line?

like image 353
vehomzzz Avatar asked Oct 14 '09 18:10

vehomzzz


People also ask

How do you delete a word from a line in Linux?

Ctrl + U = Delete left of the cursor. Ctrl + K = Delete right of the cursor. Ctrl + W = Delete word on the left.

How do I remove the first word from Notepad++?

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++.


1 Answers

: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.

like image 131
Cyber Oliveira Avatar answered Sep 27 '22 22:09

Cyber Oliveira