Quick commands guide for the vi / vim editor

Vim is a text editor that you can use in Linux environments to create or edit files.

There are two working modes in vim. One is the command mode and another is the insert mode.

To enter text or edit any line, press the “i” key on your keyboard (the i stands for Insert).

Once you’re done editing, you can exist this mode by pressing  the Esc key.

Some usefull commands:

:? – Search

dd – Delete line

p – paste below cursor

u – Undo last change

Exit Commands

:wq Write file to disk and quit the editor

:q! Quit (no warning)

:q Quit (a warning is printed if a modified file has not been saved)

For more commands see: http://www.fprintf.net/vimCheatSheet.html

 

Leave a comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.