Common Vim shortcut keys and keyboard Diagrams
Common Vim shortcut keys
H-move the cursor one character left. j-move the cursor one character down.
K-move the cursor up one character l-move the cursor down one character to 15 rows-15j
Ctrl + f-move one page down on the screen Ctrl + d-move half page down
Ctrl + B-move one page down on the screen Ctrl + u-move one half page up
N <space>-shift the cursor right n characters
0-number 0, move to the beginning of the line
$-Move to the end of the row
H-the first character in the top row of the screen
M-the first character in the center of the screen
L-the first character in the last line of the screen
G-Move to the last row of the file
NG-Move to the nth line of the file, with: set nu
Gg-Move to the first line of the file
N [Enter]-move the cursor down n rows
/Word-search down? Word-search up
N-repeat the previous search operation and the next matched string
N-opposite to n
: N1, n2s/word1/word2/g-find the string word1 between line n1 and line n2 and replace it with word2
: 1, $ s/word1/word2/g-replace in full text
: 1, $ s/word1/word2/gc-Same as above, need user confirmation
X-delete one character backward X-delete one character forward nx-delete n characters consecutively
Dd-delete an entire row ndd-delete the n rows down where the cursor is located
D1G-delete the row where the cursor is located to the first line dG-delete the row where the cursor is located to the last line
D $-delete the cursor from the end of the row d0-delete the cursor from the beginning of the row
Yy-copy the row of the cursor nyy-copy the next n rows of the cursor
Y1G-copy the current row to the first row yG-copy the current row to the last row
Y0-copy the current cursor to the beginning of the line y $-copy the current cursor to the end of the line
P-paste P in the next row of the cursor-paste one row on the cursor
J-merge the row and the next row
U-restore the previous operation [Ctrl] + r-Redo the previous operation
.-Repeat the previous operation
I-insert the cursor into the beginning of the current line
A-insert A at the end of the current row to the next sub-payment
O-Insert a new row in the next row O-Insert a new row in the previous row
R-replace the character of the cursor once R-always replace the character of the cursor
: W [filename]-Save As file: r [filename]-Open a new file at the current cursor
: N1, n2 w [filename]-Save the data from n1 to n2 as a file
: Set nu: set nonu-display or cancel row number
V-character selection V-line selection y-Copy d-delete
: N-edit next file: N-edit previous file: files-list all files
: Sp [filename]-open a new window or open a new file. Synchronous Display
[Ctrl] + w + j-switch window