开发者

Map a key to run formatter in Vim

开发者 https://www.devze.com 2023-04-03 23:13 出处:网络
I have this in my .vimrc set formatprg=astyle I can pr开发者_开发百科ess gggqG to format the whole file just fine,.

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

精彩评论

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