vim tips and tricks

makefiles

Using makefiles can save time when compiling lots of source files into one program. vim can run the makefile without leaving the editing session:

 :map <f9> :make    - map the F9 key to run make
 :set makeprg       - change what :make does

:make will compile if you are using a Makefile. Use these to examine the compile errors:

 :copen    - open a mini-window with list of errors
           - hit enter on an error to jump to line 
 :cclose   - closes the mini-window
 :cw       - toggles the mini-window (if errors exist)