开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜