I am using F5 to compile my programs
From my .vimrc
set makeprg=make\ -f\ ~/makefile\ %<
noremap <F5> :make<CR>
But I want to add one other way to compile my programs which compiles a bit slowly and use some other key say F4. I tried inserting another such statement below these lines but then F5 also compiles with the new makefile.
EDIT:
As asked in comments:
set makeprg=make\ -f\ ~/makefile\ %<
noremap <F5> :make<CR>
" slow compilation but more flags for more checks
set makeprg=make\ -f\ ~/makefile1\ %<
noremap <F4> :make<CR>
<F4>
binding? If you change'makeprg'
, it affects all:make
invocations%<
at first)::noremap <F4> :exe "make -f ~/makefile1 " . expand('%<')<CR>