Created
January 24, 2016 07:40
-
-
Save etaf/c7eb6370d0741bdb2ceb to your computer and use it in GitHub Desktop.
vimrclocal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" set F5 for compile and run c/cpp/python | |
"map <C-F5> : call CompileRunC()<CR> | |
map <F5> : call CompileRunCpp()<CR> | |
"map <F5>: call DebugCpp()<CR> | |
"map <F6> : call RunPython()<CR> | |
map <F6> : call RunShell()<CR> | |
func! CompileRunC() | |
exec "w" | |
exec "!gcc -std=c++11 -g -lboost_program_options -lpthread -lboost_system -lboost_filesystem % -o %<" | |
exec "! ./%<" | |
endfunc | |
func! CompileRunCpp() | |
exec "w" | |
exec "!g++ -std=c++11 % -lpthread -g -lpthread -lboost_thread -o %<" | |
exec "! ./%<" | |
endfunc | |
func! DebugCpp() | |
exec "w" | |
exec "!g++ % -o %< -g" | |
exec "!gdb %<" | |
endfunc | |
func! RunPython() | |
exec "w" | |
exec "!python %" | |
endfunc | |
func! RunShell() | |
exec "w" | |
"exec "!sh -x %" | |
exec "!sh %" | |
endfunc | |
nnoremap <F10> : call RunPython()<CR> | |
set noswapfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment