|
:w
|
Save
|
|
:x or :wq
|
Save & Exit
|
|
:q
|
Exit, is no changes
|
|
:q!
|
Exit, ignore any changes
|
|
:set ic
|
Ignore case while searching
|
|
:set noic
|
Case-sensitive searching
|
|
:set nu
|
Turn on line numbers
|
|
mc
|
Set marker c on this line
|
|
`c
|
Go to beginning of marker c line
|
|
'c
|
Go to first non-blank character of marker c line
|
|
h or
|
Move left
|
|
j or
|
Move down
|
|
k or
|
Move up
|
|
l or
|
Move right
|
|
w
|
Move to next word
|
|
W
|
Move to next blank delimited word
|
|
b
|
Move to the beginning of the word
|
|
B
|
Move to the beginning of the blank delimited word
|
|
e
|
Move to the end of the word
|
|
E
|
Move to the end of blank delimited word
|
|
0
|
Move to the beginning of the line
|
|
$
|
Move to the end of the line
|
|
1G or :0
|
Move to the first line in file
|
|
G or :$
|
Move to the last line in file
|
|
nG or :n
|
Move to the nth line in file
|
|
%
|
Move to associated (), {}, []
|
|
i
|
Insert before cursor
|
|
I
|
Insert before line
|
|
a
|
Append after cursor
|
|
A
|
Append after line
|
|
o
|
Open a new line after current line
|
|
O
|
Open a new line before current line
|
|
r
|
Replace one character
|
|
R
|
Replace many characters
|
|
x
|
Delete character to the right of cursor
|
|
X
|
Delete character to the left of cursor
|
|
D
|
Delete to the end of line
|
|
dd or :d
|
Delete current line
|
|
:%d
|
Delete all lines
|
|
:1,$d
|
Delete lines from beginning of file to end of current line
|
|
:x,yd
|
Delete lines x through y
|
|
ndw
|
Delete the next n words
|
|
ndb
|
Delete the previous n words
|
|
ndd
|
Delete n lines starting with current
|
|
yy or :y
|
Yank current line
|
|
y{motion}
|
Yank {motion} text
|
|
p
|
Put after the position or line
|
|
P
|
Put before the position or line
|
|
C
|
Change to end of the line
|
|
cc
|
Change the whole line
|
|
guu
|
Lowercase line
|
|
gUU
|
Uppercase line
|
|
~
|
Toggle upper and lower case
|
|
/string
|
Search forward for string
|
|
?string
|
Search backwards for string
|
|
n
|
Go to next match
|
|
N
|
Go to previous match
|
|
*
|
Search for next instance of current word
|
|
#
|
Search for last instance of current word
|
|
:s/pt/str/flag
|
Replace pattern with string
|
|
:% s/old/new
|
Replace all old with new
|
|
Flags
|
|
|
g
|
Replace all occurrences of pattern
|
|
c
|
Confirm replaces
|
|
&
|
Repeat last :s command
|
|
u
|
Undo last change
|
|
U
|
Undo all changes to line
|
|
J
|
Join lines
|
|
nJ
|
Join next n lines
|
|
.
|
Repeat last command
|
|
>
|
Indent
|
|
<
|
De-indent
|
|
(
|
Move a sentence back
|
|
)
|
Move a sentence forward
|
|
{
|
Move a paragraph back
|
|
}
|
Move a paragraph forward
|
|
fc
|
Move forward to c
|
|
Fc
|
Move back to c
|
|
:g/^$/d
|
Delete blank lines
|
|
:%s/\s\+$//
|
Delete trailing white space
|
|
:s/\s\+/ /g
|
Delete all extra white space between words
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.