Command | Description |
---|---|
:%s *$== | Delete end of line spaces |
:'a,'bs/str1/str2/g | Replace "str1" with "str2" from marker a to marker b |
:%s/\(.*\):\(.*\)/\2:\1/g | Replace the first field (\1) with the second field (\2) separated by the : |
zf | Fold a selected block of code |
zd | Unfold a block of folded code |
:make | Run Makefile |
:w|make | Write (save) current file and then run Makefile |
:grep regexp files | Find regexp in files |
:copen | Open quickfix list. Helpful after doing :make or :grep. Press Enter on entry in quickfix list to jump to that location |
:cclose | Close quickfix list |
:colder | Display contents of previous quickfix list |
:cnewer | Display contents of next quickfix list |
:!cmd | Run cmd as if on command line. Example: :!ls |
:bw | Close current buffer |
ctrl+o | Go back once through visited lines |
ctrl+i | Go forward once through visited lines |
:h topic | Get help for topic |
Software, web, and programming tips: C++, Java, C, Linux, Windows, Cygwin, Firefox, Vim, WWW, RSS
Friday, February 23, 2007
VIM - Advanced Tips
Here are some advanced tips I've learned from coworkers and working with VIM:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment