2012年(10)
分类:
2012-03-16 17:29:05
原文地址:Vim配置编译运行C/C++程序 作者:
" F5编译和运行C程序,F6编译和运行C++程序,F7运行Python程序,F10 gdb调试
" 请注意,下述代码在windows下使用会报错,需要去掉./这两个字符
"
map
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<"
exec "! ./%<"
endfunc
"< F6> 编译和运行C++
map
func! CompileRunGpp()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
"
map
"
map
func! CompileRunSH()
exec "w"
exec "!chmod a+x %"
exec "!./%"
endfunc
"
map
func! Debug()
exec "w"
exec "!gcc % -o %< -gstabs+"
exec "!gdb %<"
endfunc