Vi/vim commands are complex and powerful, and here are some of the more common commands that can be used to meet general needs.
To move the cursor:
-Shift Left: H
-Move Down: J
-Move up: K
-Shift Right: l
-page Flip: Ctrl F, CTRL b
Insert:
-Insert at cursor position: I
-Insert at end of line: a
-Insert a new line on the next line: O
Edit:
-undo Modification: U
-Replace the character where the cursor is located: r
Delete:
-delete the character of the cursor: X
-delete the remaining part of the word after the cursor: DW
-Delete the line section after the cursor: d$/d
-delete Current line: DD
-delete n rows: ndd
-line break at end of row deletion: J
Save, Exit:
-Save:: W
-Save and exit:: X/: Wq
-Exit/Forced exit:: Q/: q!
Find, replace:
-Replace string (replace all str1 with str2)::%s/str1/str2/g
-Search for a string:/str
-Search Previous, Next: N,n
Common Vi/vim Commands