You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.9 KiB
1.9 KiB
VIM Cheat Sheet
Split
<ctrl-w>sor:spor:splitsplit with line running horizontally<ctrl-w>vor:vspor:vsplitsplit with line running verticall<ctrl-w>arrowmove to pane<ctrl-w>cclose split<ctrl-w>oclose all other splits:qclose tab:tab splitmove split to new tab
Buffers
:b[num]use buffer[num]:bnnext buffer:[num]bdunload buffer[num]
Tabs
gtgo to next tabgTgo to next tab[num]gtgo to tab[num]:tabnewopen new tab:tabcclose tab:tabeedit file in new tab
Auto Complete
<ctrl-x><ctrl-o>omni completion<ctrl-y>,emmet<ctrl-]>abbreviations<ctrl-n>word completion
Navigation
<ctrl-f>page down<ctrl-b>page up<ctrl-d>half page down<ctrl-u>half page upHmove to top of screenMmove to middle of screenLmove to bottom of screen
Editing
dwdelete forward to end of worddbdelete backward to beginning of wordDdelete to end of lined^delete to beginning of linedvbdelete backward to beginning of word including current charxdelete current charXdelete previous char:%s/wordtochange/changedvalue/gcsearch/replace
Copying
"+ycopys visual selection to clipboardyycopys entire line[num]yyyank[num]linesybyank previous wordywyank next word
Formatting
=auto indent selection/linegg=Gauto indent entire bufferJjoin current line with next line
Comments
\c<space>- Nerdcommentor<ctrl-v>then select block. Then<shift-i>to enter insert. Enter text and hitEsc
Selection
vvisual characterVvisual line<ctrl-v>visual block<option-click>visual block, highlight from start to click point
Commands
:%s/\s\+$//etrim ending whitespace:%retab!convert spaces to tabsNERDTreeopen up nerd tree file explorer
NERDTree
rrefresh tree