|
ESC
|
Command mode, toggles modes when in insert or visual mode
|
|
i
|
insert mode
|
|
v
|
Visual mode, start highlighting characters
|
|
V
|
Visual mode, start highlighting lines
|
|
:shell
|
Opens command prompt
|
|
exit
|
Exits command prompt
|
|
:e filename
|
Open a new file
|
|
:w filename
|
Save changes to a file
|
|
:q
|
Exit Vim. If there is unsaved files, Vim will not exit
|
|
:q!
|
Exit Vim wihout saving changes
|
|
:x or zz
|
Exits Vim and saves changes to the file if changes were made
|
|
u
|
Undo last action
|
|
U
|
Undo all the latest changes that were made to the line
|
|
Ctrl+r
|
Redo
|
|
o
|
Open new line BELOW the cursor
|
|
O
|
Open new line ABOVE the cursor
|
|
:tabnew
|
Opens a new tab
|
|
gt
|
go to next tab
|
|
gT
|
Go to previous tab
|
|
:tabmove n
|
Move tab to position n
|
|
:tabc
|
Close tab
|
|
yy
|
Yank the current line
|
|
:y
|
Yank the current line
|
|
y
|
Yank the highlighted text
|
|
:d or dd
|
Delete current line
|
|
D
|
Delete to the end of the line
|
|
d
|
Delete the highlighted text
|
|
dw
|
Delete word
|
|
dl
|
Delete character at cursor position
|
|
p
|
Put text after cursor position, put lines below current line
|
|
P
|
Put text before cursor position, put lines above current line
|
|
x
|
Delete current character
|
|
:split or :sp
|
Splits the current window horizontally
|
|
:vsplit or :vs
|
Split the current window vertically
|
|
:split file
|
Opens the file in a second window
|
|
:n split file
|
Opens a new window n lines high
|
|
:new
|
Opens a new window horizontally
|
|
:vnew
|
Opens a new window Vertically
|
|
:res n
|
Resizes window to n line size, if n is not provided window is resized to max size
|
|
CTRL-ww
|
Switches cursor between windows
|
|
CTRL-w <motion key>
|
Switches cursor between windows in motion key direction
|
|
CTRL-wn
|
Splits a window and starts editing a new file
|
|
CTRL-w r
|
Rotate windows positions
|
|
CTRL-w q or :q
|
Close window
|
|
h or left
|
Move LEFT one character
|
|
j or down
|
Move DOWN one line
|
|
k or up
|
Move UP one line
|
|
l or right
|
Move RIGHT one line
|
|
H
|
Move to the FIRST line of the screen
|
|
M
|
Move to the MIDDLE line of the screen
|
|
L
|
Move to the LAST line of the screen
|
|
b
|
Move to the BEGINNING of the word
|
|
B
|
Move to the BEGINNING of a blank delimited word
|
|
e
|
Move to the END of the word
|
|
E
|
Move to the END of black delimited word
|
|
w
|
Move to the NEXT word
|
|
W
|
Move to the NEXT blank delimited word
|
|
:n
|
Jump to line n (jump to line 42->:42)
|
|
:buffers
|
find list of buffers
|
|
:b number
|
Select buffer number
|
|
:sb number
|
Splits the window and starts editing the buffer
|
|
:vertical sbuffer number
|
Splits the window vertically and edits the buffer
|
|
:bnext or :bn
|
Go to the next buffer
|
|
:bdelete
|
Deletes a buffer without saving
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.