Wednesday, September 19, 2007

common but not so commonly used "VIm" commands

for my reference purpose:

line cut and paste: d, p
highlight cut and paste: v, y, p
search the word under the cursor: *
find and replace:
%s/findstring/replacestring/gc or
:gs?pat?sub?
g=global
c=confirm

Any word completion: ctl-n

Write mode: Insert
Non-write mode: Escape

find: /
line cut: d
highlight/visual: v
yank: y
paste: p
write: w
force write: w!
quit: q
force quit: q!
write and quit: wq

No comments: