vim代码片段插件ultisnips的使用
ultisnips是一个可以自动进行代码补全的插件,可以通过Vundle进行安装,要启用ultisnips,首先可以下面的配置信息写入到~/.vimrc
" Track the engine. Plugin 'SirVer/ultisnips' " Snippets are separated from the engine. Add this if you want them: Plugin 'honza/vim-snippets' " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. let g:UltiSnipsExpandTrigger="<c-b>" let g:UltiSnipsJumpForwardTrigger="<c-b>" let g:UltiSnipsJumpBackwardTrigger="<c-z>" " If you want :UltiSnipsEdit to split your window. let g:UltiSnipsEditSplit="vertical"
请注意我这边设置通过ctrl+b触发代码补全,因为我已经安装了YouCompleteMe插件,所以能使用tab来触发补全
配置完成后使用在vim中使用:PluginInstall安装插件
我们也可以自己定义语法,格式如下:
snippet 触发字符 ["代码片段说明" [参数]] 代码片段内容 endsnippet
相关推荐
yonggeno 2019-12-28
RichardJason 2015-03-01
SlowWakler 2015-03-01
xujidong0 2014-11-03
gotowqj 2014-01-15
rootdream 2012-08-25
shutFuckingup 2010-09-25
xlb 2018-07-02
wuchangqian 2019-06-30
rootdream 2019-06-30
rootdream 2019-06-26
缘起 2019-06-21
xlb 2014-08-22
lethwei 2011-10-19
codethinkwrite 2018-07-23