Vim - gwenn/hypomnemata GitHub Wiki
- VIM Quick Reference Card
- Vimdoc
- Vim Tips wiki
- Vim Notes
- Best of Vim Tips
- Quick Reference
- Vim Cookbook
- Graphical vi-vim Cheat Sheet and Tutorial
- Linux Productivity Magazine - VI and Vim
-
*Search forward for the keyword under the cursor -
#Same as "*", but search backward -
/{pattern}[/]<CR>Search forward -
?{pattern}[?]<CR>Search backward
:%s/\_. -> /, /gc
/<\(\w\+\)>\_s*<\/\1>
[{ Move to the start of the current block
-
gfEdit the file whose name is under or after the cursor -
C-w fEdit the file whose name is under or after the cursor in a new window -
C-w gfEdit the file whose name is under or after the cursor in a new tab
-
<C-X><C-F>filenames completion
-
tabstop(ts) (8) -
expandtab(et) (noexpandtab) -
shiftwidth(sw) (8) -
softtabstop(sts) (0) (useful only when shiftwidth <> tabstop)
"no tab
set et sw=2 sts=2 (set expandtab shiftwidth=2 softtabstop=2)
set et sw=2 sts=2 ts=7
"tab
set noet sw=2 sts=0 ts=2
set noet sw=7 sts=0 ts=7map \M <Esc>:set noet sw=8 sts=0 ts=8<CR>
map \m <Esc>:set et sw=2 sts=2<CR><!-- vim: set encoding=utf-8: -->
# vim: set expandtab softtabstop=2 shiftwidth=2::[range]g[lobal]/{pattern}/[cmd]<CR> where {pattern} matches
:[range]g[lobal]!/{pattern}/[cmd]<CR> where {pattern} does NOT match
-
C-XDecrement a number -
C-AIncrement a number
-
gumLowercase text operated on by motion m -
gUmUppercase text operated on by motion m -
g~mSwitch case
%s/^/\=strpart(eval(line('.')-1)." ",0,&ts)
:%!xmllint --format -
gg=G or G=gg
:set diffopt=filler,iwhite
:%g/^\d\+/d^M:%g/^---/d^M:%s/^> /+;/^M:%s/^< /-;/^M:w
:compiler perl
:set makeprg=/path/to/perl\ -c\ -W\ %
autocmd BufRead *.pl,*.pm compiler perl | set makeprg=/path/to/perl\ -c\ -W\ %
ctags -R -V --exclude='.svn'
:set tags+=$MY_REP/tags,$OTHER_REP/tags
C-Q = C-V doc