Skip to content

Instantly share code, notes, and snippets.

@erjiaqing
Created May 12, 2014 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erjiaqing/70180429e4e42d04b779 to your computer and use it in GitHub Desktop.
Save erjiaqing/70180429e4e42d04b779 to your computer and use it in GitHub Desktop.
vimrc
set nu
set ai
set ci
set ts=4
set sw=4
set sts=4
sy on
set si
function g:compileByFileType()
if &filetype=="c"
nmap <f9> :!gcc % -o %< -O2 -g -static -std=c99<cr>
imap <f9> <esc><f9>
elseif &filetype=="cpp"
nmap <f9> :!g++ % -o %< -O2 -g -static -std=c++98<cr>
imap <f9> <esc><f9>
elseif &filetype=="python"
nmap <f9> :!python %
imap <f9> <esc><f9>
endif
endfunction
autocmd FileType * call g:compileByFileType()
nmap <f3> :w<cr>
imap <f3> <esc><f3>a
nmap <f6> :!gdb %.out<cr>
imap <f6> <esc><f6>a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment