Skip to content

Instantly share code, notes, and snippets.

@dahu
Created July 1, 2015 06:51
Show Gist options
  • Save dahu/f8c4f0ed68dd63df82cf to your computer and use it in GitHub Desktop.
Save dahu/f8c4f0ed68dd63df82cf to your computer and use it in GitHub Desktop.
Poor man's make
" poor man's make
" Barry Arthur, July 2015
function! MK()
cclose
write
let res = system('gcc -std=c++11 ' . shellescape(expand("%")))
if ! v:shell_error
exe "! ./a.out"
else
call writefile(split(res, "\n"), 'errors')
cf errors
copen
endif
endfunction
nnoremap <f5> :call MK()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment