vi cursor movement

2009 Mar 01


h
j
k
l
left
down
up
right
w
W
b
B
e
E
forward by word
forward by word after white space
backward by word
backward by word after white space
end of word
end of word before white space
0
$
first column of current line
last column of current line
-
^
+
RET
n|
first non blank of prev line
first non blank of curr line
first non blank of next line
first non blank of next line
column n of curr line
zRET
z.
z-
reposition line with cursor to top of screen
reposition line with cursor to middle of screen
reposition line with cursor to bottom of screen
nH
H
M
L
nL
n lines after top of screen
top line of screen
middle line of screen
bottom line of screen
n lines before bottom of screen
Ctrl-F
Ctrl-D
Ctrl-E
Ctrl-L
Ctrl-Y
Ctrl-U
Ctrl-V
scroll forward one screen
scroll forward one half screen
show one more line at bottom
redraw screen without scrolling
show one more line at top
scroll backward one half screen
scroll backward one screen
/pattern
?pattern
search forward for pattern
search backward for pattern
/
?
repeat previous search forward
repeat previous search backward
n
N
repeat last search in same direction
repeat last search in opposite direction
fx
Fx
tx
Tx
search forward for character x in curr line
search backward for character x in curr line
search forward to character before x in curr line
search backward to character after x in curr line
; repeat previous curr line search
' repeat previous curr line search in opposite direction
Ctrl-G display current line number
nG
:n
move to line n
G
:$
move to last line
mx
`x
` `
mark current position as x
move cursor to mark x
return to previous mark or context
'x
' '
move to beginning of line containing mark x
move to beginning of line containing previous mark
%
If cursor is on one of: ( ) [ ] { }, it goes
to balancing character, e.g. from ) to (.

2005-2009