Deletion Commands in Vim
Always use the Esc key to go into normal mode and use the insertion, deletion keys, and other keys.
To delete the word move the cursor to the beginning of the word and use dw command in normal mode. The word under the cursor will be deleted.
dw
To delete more than one word in a single line use the following command.
To delete 2 words use the command
d2w
To delete the line move cursor to the beginning of the line and use d$ command in normal mode. The line under the cursor will be deleted.
d$
Undo and Redo:
As we are programmers most time we are using undo and redo .vim to provide these to both features in it. To undo press u key in normal mode
u
To redo use the ctrl+r key in normal mode in vim
ctrl+r
Vim Editor in Linux
If you’re new to the world of Linux, one of the first things you’ll encounter is the command line interface. And if you’re going to be working in the command line, you’ll inevitably come across various text editors. Among them, Vim stands out as a powerful, yet notoriously complex, text editor. In this guide, we’ll take you through everything you need to know about Vim, from its basics to more advanced features, to help you get started on your journey with this essential tool.
Contact Us