Sunday 24 April 2011

VI editor shortcuts

:: VI COMMANDS ::

Cursor movements
h ~ left one character
l ~ right one character
j ~ down one line
k ~ up one line
w ~ right one word
b ~ back one word

Deleting, Yanking, and Pasting
d ~ delete
x ~ delete character cursor is on
r ~ replace one character
y ~ yank (copy into temporary buffer)
Y ~ yank line cursor is on
p ~ paste below cursor line (deleted or copied text)

Saving and Exiting
u ~ undo last editing command
ZZ ~ save and exit (hold down shift and press "z" twice)
:wq! ~ write and quit even if it is read-only.

No comments:

Post a Comment