= General
== Changes
ci"- change inside "ca"- change around "ciw- change inside a word
== Movement to be written
== Windows
-
All window commands start with
ctrl w -
To move back to the NERDTree window from another split window in the current tab, use
ctrl wworctrl wh -
To move between windows in general,
ctrl whtakes you left,ctrl wltakes you right,ctrl wjtakes you down andctrl wktakes you up. -
To quit a window use
ctrl wq -
Custom bindings: Navigate through windows using
Command-Option-arrows
== Tabs
gt- next tabgT- previous tab
= Plugins == Surrounds
Surround text with tags/quotes/parenthese
- b, B, r, and a are aliases for ), }, ], and >
<command><motion?><target>- commands:
cs== change surroundingds== delete surroundingys== you surround (add surrounding)
- motion:
- none - context of current
iw- word (beggining -> end)w- cursor to the and of words- line
- target:
- b = )
- B = }
- r = ]
- a = >
- t = any kind of tag (eg. for removal or replacement)
- examples (* indicates cursor position):
ysiw(=f\*oo->(foo)ysiwr=f\*oo->[foo]yswr=f*oo->f[oo]dst=<p>*Foo</p>-> 'Foo'
== NERDTree
NERDTree is a plugin displaying simple file manager/navigator in a ViM window
- Custom bind:
<Leader>-p- toggle NERDTree - To open a tab and move into it use
jorkto navigate the file you want to open, then hittfrom the NERDTree window - To open a tab but stay in the current tab, use
jorkto navigate the file you want to open, then hitTfrom the NERDTree Window - To move a file in the NERDTree window, use
m - To add a file in the NERDTree window, use
a
== VCS command
CVS/SVN/SVK/git/hg/bzr integration plugin
<Leader>ca VCSAdd<Leader>cn VCSAnnotate<Leader>cN VCSAnnotate!<Leader>cc VCSCommit<Leader>cD VCSDelete<Leader>cd VCSDiff<Leader>cg VCSGotoOriginal<Leader>cG VCSGotoOriginal!<Leader>ci VCSInfo<Leader>cl VCSLog<Leader>cL VCSLock<Leader>cr VCSReview<Leader>cs VCSStatus<Leader>cu VCSUpdate<Leader>cU VCSUnlock<Leader>cv VCSVimDiff
Only for CVS buffers:
<Leader>ce CVSEdit<Leader>cE CVSEditors<Leader>ct CVSUnedit<Leader>cwv CVSWatchers<Leader>cwa CVSWatchAdd<Leader>cwn CVSWatchOn<Leader>cwf CVSWatchOff<Leader>cwf CVSWatchRemove
== Ack
- General usage:
:Ack [options] {pattern} [{directory}]
In the quickfix window, you can use:
- Custom binding:
<Command-Shift-F>to:Ack oto open (same as enter)goto preview file (open but maintain focus on ack.vim results)tto open in new tabTto open in new tab silentlyvto open in vertical splitgvto open in vertical split silentlyqto close the quickfix window
Useful option: --type=TYPE, --type=noTYPE
Specify the types of files to include or exclude from a search. TYPE is a
filetype, like perl or xml. --type=perl can also be specified as --perl,
and --type=noperl can be done as --noperl.
== Conque Term
Terminal in a ViM buffer
Type :ConqueTerm to launch an application in the current buffer. E.g.
- Custom binding:
<Command-e>for:ConqueTerm $SHELL --login :ConqueTerm bash:ConqueTerm mysql -h localhost -u joe\_lunchbox Menu:ConqueTerm man top
== NERD Commenter
Comment/uncomment code easily
[count]<leader>ccComment out the current line or text selected in visual mode.[count]<leader>cnSame as cc but forces nesting.[count]<leader>c<space>Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa.[count]<leader>cmComments the given lines using only one set of multipart delimiters.[count]<leader>ciToggles the comment state of the selected line(s) individually.[count]<leader>csComments out the selected lines "sexily"[count]<leader>cySame as cc except that the commented line(s) are yanked first.<leader>c$Comments the current line from the cursor to the end of line.<leader>cAAdds comment delimiters to the end of line and goes into insert mode between them.<leader>caSwitches to the alternative set of delimiters.[count]<leader>cl[count]<leader>cbSame asccexcept that the delimiters are aligned down the left side (<leader>cl) or both sides (<leader>cb).[count]<leader>cuUncomments the selected line(s).
== Taglist
The "Tag List" plugin is a source code browser plugin for Vim. This plugin allows you to efficiently browse through source code files for different programming languages.
Requires: ctags
:TlistToggle- open/close the taglist window:TlistOpen- open taglist<Enter>or doubleclick - open fileo- open tag in new windowp- open tag in new window, but keep cursor in tag listt- open tag in new tab
== ctags
- *Custom binding:
<Leader>rtregenerate ctags
== SuperTab
- Just hit
<Tab>in insert mode
== SnipMate
- Just hit
<Tab>
== Align
Align lets you align statements on their equal signs, make comment boxes, align comments, align declarations, etc.
:5,10Align =>to align lines 5-10 on=>'s
== SearchFold
== Syntastic
== Gist