vim - How to map function keys to compile my program? -
in vim want map function key fn compiling open c/c++ file. possible ? if yes please guide me.
it possible , preferred way of working.
i have following in .vimrc
:
nnoremap <f5> :make<cr>
this call 'makeprg'
, defaults 'make'
. can use results in vim's quickfix mode tackle compilations errors, warnings, etcetera, (with correct setup) deliver cursor right error lies in code.
if want compile current file, set 'makeprg'
other 'make
', such compiler, followed current file:
:set makeprg=g++\ %
[but you'll need add compiler flags such include paths, etc.]
if you're using alternative build system, such boost build, scons, et cetera, humbly recommend using makeshift
set 'makeprg'
you.
help topics in vim underway:
Comments
Post a Comment