首页 > 系统服务 > 详细

vim代码片段插件ultisnips的使用

时间:2020-02-09 10:26:46      阅读:78      评论:0      收藏:0      [点我收藏+]

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

vim代码片段插件ultisnips的使用

原文:https://www.cnblogs.com/zmichael/p/12286036.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!