Sunday, February 26, 2012

Vim alphabet soup



aappend mode
Aappend to end of line
btraverse word wise back
Btraverse word wise back
cchange followed by motion command
cw - change a word
3cw - change 3 words right
c0 - that is c zero, change from current pos to begining of line
c$ - change from current pos to till end of line
ct - change till followed by char or pattern i.e motion forward dir.
cf - change till including followed forward dir.
cT - change till followed by char or pattern i.e motion backward dir.
cF - change till including followed backward dir.
cgg - change from cur.pos. to beg. of file
cG - change from cur.pos. to end of file
ciw - change a word, when you are in middle of word
caw - change a word including space after word
ci - could be quotes brackets or braces
CChange till end of line ( = c$ )
ddelete can be preceded count and followed by motion
dw - delete a word
3dw - delete 3 words right
dd - delete entire line, can precede count, use p to paste same line
d0 - that is d zero, delete from current pos to begining of line
d$ - delete from current pos to till end of line
dt - delete till followed by char or pattern i.e motion forward dir.
df - delete till including followed forward dir.
dT - delete till followed by char or pattern i.e motion backward dir.
dF - delete till including followed backward dir.
dgg - delete from cur.pos. to beg. of file
dG - delete from cur.pos. to end of file
diw - delete a word, when you are in middle of word
daw - delete a word including space after word
dwwhp - swap words
ddp - swap lines
DDelete till end of line ( = d$ )
emove to word wise, places cursor at end of each word
Emove to word wise, places cursor at end of each WORD
ff is a motion char it should followed by a char
To [count]'th occurrence of {char} to the right. The cursor is placed on {char}
FF is a motion char it should followed by a char
To [count]'th occurrence of {char} to the left. The cursor is placed on {char}
gg is a motion command it should be followed by some chars
g~w - change case of a word
10gg - to goto 10th line of file
gg - goto begining of file
gi - goto last insert position
gf - goto file on cursor pos.
gd - goto definition of cursor pos
Ggoto end of file
hmove left one char <-
Htop of screen
iinsert mode
IInsert mode , insert always starts at beginning of line
jdown one line
JJoin line
kup one line
Kdocumentation for word under cursor
lright one char ->
Lbottom of screen
mset mark followed by register char ( a-z A-Z 0-9)
MMiddle of screen
nnext find
NPrev find
oinsert blank next to current line
Oinserts blank above current line
ppaste
Ppaste at cursor pos.
rreplace one char
10r. - replaces 10 dots
RReplace mode
ssubstitute single char
Ssubstitue entire line
tTill before [count]'th occurrence of {char} to the right. The cursor is placed on the character left of{char
; is used to find next, comma is used for finding prev occurrence of {char}
TTill before [count]'th occurrence of {char} to the left. The cursor is placed on the character right of{char
; is used to find next, comma is used for finding prev occurrence of {char}
uundo
UUndo all changes on current line
vlinewise visual mode but from current pos
Vlinewise visual mode
wword wise , moves to beginning of word right
Wword wise , moves to beginning of word left
xdelete a char at current cur.pos
xp - swap next two characters around
Xdelete previous char at current cur.pos
yyank or copy
zz with motion is used for folds
~swap case
0zero, begin of line
^begin of line
$end of line
%to match corresponding brackets,braces or curlies
match brackets
matchit.vim : % now matches tags <tr><td><script> etc
#find and highlight all occurrences of current word backward
*find and highlight all occurrences of current word forward
-move prev. line
+move next line
.to repeat last insert
=(re)indent the text on the current line or on the area selected (SUPER)
>>shift line right, can preced count
>i} - shifts right whole content within curlies
>a} - shifts right whole content including curlies
<<shift line left
/forward search pattern
?backward search pattern

guulowercase line
gUUuppercase line
~invert case (upper->lower; lower->upper) of current character
gfopen file name under cursor (SUPER)
gadisplay hex, ascii value of character under cursor
g8display hex value of utf-8 character under cursor
ggg?Grot13 whole file
xpswap next two characters around
dwwhpswap words
ddpswap lines
CTRL-A,CTRL-Xincrement, decrement next number on same line as the cursor
CTRL-R=5*5insert 25 into text
=(re)indent the text on the current line or on the area selected (SUPER)
=%(re)indent the current braces { ... }
G=ggauto (re)indent entire document
!!filter through shell command
5!! - filter 5 lines though shell command equal to( :.,+4! )
CTRL-e, CTRL -y- in insert mode holding these key combinamtions copy contents from below, above lines.
*g* g# : find word under cursor (forwards/backwards)
CTRL -N: word completion in insert mode
CTRL -X CTRL -LLine complete SUPER USEFUL
/ CTRL -R CTRL -WPull onto search/command line
q:to traverse ex mode history

No comments:

Post a Comment

Followers