Saturday, December 24, 2011

The most common commands used in Vim

Movement commands
CommandDescription
hmove left
jmove down
kmove up
lmove right
ctrl + bpage up
ctrl + fpage down
$move to end of the line
0move to beginning of the line
^move to the first non-blank character of the line
Gjump to end of the file
ggjump to beginning of the file
10Ggot to line
wmove foward to the word
bmove backward to the beginnig of a word
}jump foward one paragraph
{jump backward one paragraph

Editing commands
CommandDescription
dcut
ycopy
ppaste
dddelete line
yycopy line
uundo
redredo
~upper or lower case
istart insert mode at cursor
Iinsert at the beginnig of the line
aappend after cursor
Aappend the end of the line
eaappend the end of the word

Search commands
CommandDescription
/textsearch forward in the document for text
nmove foward to the search result
Nmove backward to the search result

File editing commands
CommandDescription
wwrite to file
eopen file
pwdshow current directory
cdswitch Vim to directory
:browse eopen dialog
:qclose
:q!close and drop changes
Folding commands
CommandDescription
zRopen all
zMclose all
zoopen
zcclose
Other commands
CommandDescription
:set listdisplay whitespaces
:set nolistdisplays normaly
:copenopens error window
:cclosecloses error window
:set expandtabto insert space characters whenever the tab key is pressed
:retabto change all the existing tab characters to match the current tab settings
:TlistToggleopens the taglist window

No comments:

Post a Comment