Is it possible in vim to do a conditional map, in normal mode? I've seen it for insert mode. I want to remap gq, depending on the outcome of a function. Something like:
nnoremap gq if(g:set_formatprg()) | gq | else | = | endif
Notice that g:set_formatprg()
will not always have the same value, so it cannot be replaced by
if(!g:set_formatprg()) | nnoremap gq = | endif