[[email protected] biji]# vim + 1.txt Open the file, the cursor is positioned to the last line
[[email protected] biji]# vim +5 1.txt Open file, cursor to line 5th
[[email protected] biji]# vim +/nobody 1.txt Open the file, the cursor is positioned to the first occurrence nobody position by the letter N switch nobody position
[[email protected] biji]# vim AA bb cc simultaneously create AA bb cc Press: n switch to BB file and press N to switch to cc file: N switch back with: Prev
common low-line commands
: w Save memory
: Q Exit
:! Forcing
: LS lists all open files
: N Toggles the next open file
: N switches to previous file
: 15 Switch to 15 rows
/xxx search XXX appears position cursor positioning to there
? XXX forward search, cursor positioning to there
h cursor Shift left
J Cursor Move Down
k move Cursor up
L MOVE the cursor right
ctrl+f PAGE DOWN
ctrl+b PAGE Up
ctrl+d down half page
ctrl+u up half a page
DD Delete the line where the cursor is located
o insert a row down the line where the cursor is located
yy copy cursor line
p paste below the line where the cursor is located
P paste above the line where the cursor is located
Vim shortcut keys and tips