Vim Notes & Tricks
My Vim Plugins
-
Pathogen. Elegant plugin manager.
-
Matchit.vim, extended % matching for HTML, LaTeX, and many other languages.
-
surround.vim, delete/change/add parentheses/quotes/xml-tags/much more with ease.
-
ctags + taglist. Ctags is actually a standalone program, capable of generating a list of functions/variables/classes, i.e. 'tags', found in files in different languages. Taglist.vim displays the result in a vsplit (to get rid of the left-hand scroll bar when it is displayed,
:set guioptions-=L). A list of ctags tricks here.
Basic Editting Stuff
-
If some lines are highlighted in visual mode (checkout
visual-mode), press J to join them altogether.
Some Notes
-
I have read some help texts, many tutorials, and tried to program some simple task. But it seems very hard to get familiar with Vim scripts (Feb 03, 2011 13:48:33)
Substitution
<nowiki>:s/\(\w\+\)/\1 # /</nowiki>
Change <nowiki>A B</nowiki> to <nowiki>A # B</nowiki>.
Commands
Datestamp
Add
nnoremap <F5> 3wv$"=strftime("%c")<CR>P
to your VIMRC. Place cursor on the head of "Last Modified" line and <F5>. See also.
Linux-related
Use vim-gtk or vim-gnome under linux (for instance, under vim-basic "+y, or the system clipboard, will not work).
Useful Links & Resouces
-
Some tutorial videos here (http://ontwik.com/tools/vim-from-novice-to-professional-by-derek-wyatt-p1/).
-
http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-novice-tutorial-videos/
-
http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-intermediate-tutorial-videos/
-
http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-advanced-tutorial-videos/
-
http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-plugin-showcase/
-
http://www.linuxconfig.org/Vim_Tutorial
Last Modified: February 06, 2012 18:54:24