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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-07-14
  • 2021-12-25
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
  • 2021-11-01
  • 2021-06-05
相关资源
相似解决方案