w
forward to beginning of the next wordW
forward to beginning of the next word (whitespace separates)e
forward to end of next wordE
forward to end of next word (whitespace separates)b
back to beginning of the previous wordB
back to beginning of the previous word (whitespace separates)ge
back to end of the next wordgE
back to end of the next word (whitespace separates)fn
find and move to the next occurrence of n
. You can follow this with a ;
to repeat the find/move. You can also use ,
to go back one match.tn
find and move to (until) the character preceding the next occurrence of n
. As above, ;
repeats, and ,
goes back one match.Fn
find and move to the previous occurrence of n
. ;
repeats, ,
goes back one match.Tn
find and move to (unTil) the character following the next occurence of n
. ;
repeats, ,
goes back one match./term
search forwards for term
?term
search backwards for term
cfn
- change the text up to where you find the next occurrence of n
cFn
- change the text back to where you Find the previous occurrence of n
^f
forward a page/screen^b
back a page/screen^u
up half a page/screen^d
down half a page/screenH
go to Head (top) or “High point” of screenM
go to Middle of screenL
go to Last line or “Low point” of screengg
first line of documentG
last line of document500G
line 500*
search forwards for word currently under cursor (use with n
and N
)#
search backward for word currently under cursor (use with N
and n
- note that direction is reversed)%
matching bracket, brace, square bracket - see matchit.vim for extended behaviorma
set position of (book)mark a
:marks
list currently defined marks'a
jump to rot for mark a
jump to row/column for mark
a`i
insert at cursorI
insert at beginning of linea
append after cursorA
append at end of liner
replace a single characterR
replace any number of charactersc<motion>
change, e.g. cw
is change wordx
delete character under cursorX
delete character before cursord<motion>
delete, e.g. dw
is delete word, dd
is delete lineSee http://vim.wikia.com/wiki/VimTip386 for more detailed info.
v
(for visual mode) to start the selection (or V
to select whole lines, or Ctrl-v
for a vertical block)d
for delete (cut) or y
for yank (copy)P
or p
for paste before or after cursor, respectivelyFor an excellent tutorial, see http://reefpoints.dockyard.com/2013/10/22/vim-buffers.html
:badd
:ls
#
) buffer: CTRL+6
:bp
:bn
:bx
:bd
:bd x y
For another excellent tutorial, see http://reefpoints.dockyard.com/2013/11/27/vim-windows.html
CTRL+w s
CTRL+w v
CTRL+w h
CTRL+w l
CTRL+w k
CTRL+w j
CTRL+w r
CTRL+w R
CTRL-w H
CTRL-w J
CTRL-w K
CTRL-w L
CTRL-w =
CTRL-w >
CTRL-w 20 >
CTRL-w <
CTRL-w 20 <
CTRL-w -
CTRL-w 10 -
CTRL-w +
CTRL-w 10 +