Adding Compilation Flags for Certain Filetypes
Sometimes you just need more compilation flags for your source files. You can automate this by using
:SCCompileRunAF. For example, if one needs to link libz for all C source, you could add the following lines to your
autocmd Filetype c nmap <buffer> <F9> :SCCompileAF -lz <CR> autocmd Filetype c nmap <buffer> <F10> :SCCompileRunAF -lz <CR>
In this way, pressing would compile the C source file with an additional
-lz flag and pressing would compile and run the binary.