Skip to content

Instantly share code, notes, and snippets.

@akira093
Created May 7, 2013 08:56
Show Gist options
  • Save akira093/5531240 to your computer and use it in GitHub Desktop.
Save akira093/5531240 to your computer and use it in GitHub Desktop.
" C
autocmd FileType c nnoremap <buffer> <F5> :call <SID>execGcc()<CR>
autocmd FileType c nnoremap <buffer> <F6> :call <SID>runC()<CR>
autocmd FileType c nnoremap <buffer> <F7> :call <SID>runCToFile()<CR>
function! s:execGcc()
:w
exe ":!gcc % -lm -O2 -o %.out"
endfunction
function! s:runC()
exe ':!' . expand('%') . '.out'
endfunction
function! s:runCToFile()
exe ":!./%.out > %.data"
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment