Map a key to run formatter in Vim
I have this in my .vimrc
set formatprg=astyle
I can pr开发者_开发百科ess gggqG
to format the whole file just fine,.
Now I'd like to map a hotkey to do this, eg <F10>
, but gggqG
is not a command I type in Vim command line, so I don't know how to map this to a key. Thanks for the help.
You can use map:
map <F10> gggqG
精彩评论