Friday, September 27, 2013

Compile OpenCV based c/c++ from VIM without exiting editor

map  :call CompileRunGcc()
func! CompileRunGcc()
  exec "w"
  exec "!g++ `pkg-config opencv --cflags --libs` % -o %<"
  exec "! ./%<"
endfunc 
 http://www.linuxquestions.org/questions/programming-9/gcc-from-within-vim-481820/