linux vim command arguments and vim workflow

Vim Very powerful text editor. As a R&D engineer, you must be proficient in the vim command.

Vim is divided into three modes: Command Mode, Insert Mode and Last Line Mode.

The effects of these three modes are:

  • Command Mode: Start vim, it enters the command mode, press i for insert mode
  • Insert Mode: In the insert mode, some function keys can be used. ESC, exit insert mode, switch to command mode.
  • Last Line Mode: In command mode, press : to enter the last line mode.

Linux vim workflow

Vim common shortcuts

h , ←Cursor moves one character to the left
j , ↓Cursor moves one character down
k , ↑cursor moves up one character
l , →cursor moves one character to the right
oopens a line below the cursor and start Insert mode
ainserts text after the cursor
ecommand moves to the end of a word
: xsave and exit
:wqsave and exit
:q!trash all changes
xto delete the unwanted character
uundo the last the command and U to undo the whole line
:s/old/new/gsubstitute ‘new’ for ‘old’ where g is globally
ggmove you to the start of the file
Gmove you to the bottom of the file
vstarts visual mode
dddelete current line
:set nudisplay line number

Add a Comment

Your email address will not be published.