lingceng 发表于 2013-1-26 12:29:34

Develop C with vim

OS:Ubuntu12.04
Vim version:7.3


Abstract:
fast compile c program with vim by set makeprg; fast run C program by map!.


Basics:
type vimtutor in shell to get the basic command in vim
:help makeprg
:help map


Key:
set makeprg to fast compile C, append the following lines in ~/.vimrc

"compile with make, -lm when necessary "set makeprg=gcc\ -ansi\ -Wall\ -o\ %\ $*  
" run c program with run "map! run !./%< 
页: [1]
查看完整版本: Develop C with vim