Skip to content

Instantly share code, notes, and snippets.

@scajanus
Created September 20, 2012 15:50
Show Gist options
  • Select an option

  • Save scajanus/3756729 to your computer and use it in GitHub Desktop.

Select an option

Save scajanus/3756729 to your computer and use it in GitHub Desktop.
nnoremap <F5> :w\|:make<CR>
nnoremap <F6> :!./main<CR>
autocmd FileType cpp call <SID>cppstuff()
" C++-special hook"{{{
function! <SID>cppstuff()
if filereadable("Makefile")
set makeprg=make
else
set makeprg=g++\ -std=c++0x\ -Wall\ -Wextra\ -pedantic\ -g\ -D_GLIBCXX_DEBUG\ -o\ main\ %:h/*.cc
endif
nmap <M-a> <Esc>:!ctags *.cpp *.h<CR>
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment