vim-ultisnips补全功能失效,无法识别解决办法

昨天又给vim配了一堆插件

发现了一个这个问题,vim的ultisnips插件不能用了!

首先,我先查看插件是否正常运行了

:script

从一堆正在运行插件里找到ultisnips的名字,说明插件正常运行

难道是因为键冲突,想想昨天装的插件,没有用到<tab>键的呀,我并没有使用supertab插件

于是在vimrc把ultisnips的触发键改了

let g:UltiSnipsExpandTrigger="<c-q>"

结果还是没反应。。。蛋疼了

会不会没开文件检测?

syntax on                    " 开启文件类型侦测
filetype indent on           " 针对不同的文件类型采用不同的缩进格式
filetype plugin on           " 针对不同的文件类型加载对应的插件
filetype plugin indent on    " 启用自动补全

去vimrc中检查,都开了呀。。。

然后,突然发现date、time等all.snipets里的内容可以补全,这个是通用补全文件,和文件类型是没有关系的,然而唯独这个正常。

于是乎,google到了以下网页

https://github.com/VundleVim/Vundle.vim/issues/16

其中,有这么一段是这么说的

As seen above, lots of UltiSnips users end up running into filetype-related issues if they configure this incorrectly (e.g. when using the UltiSnipsEdit command). For me, it was important to have the entire block of Vundle configuration in one piece, with the two filetype calls immediately above and below it (as shown by @gmarik above). Hopefully this helps someone who comes across this in the future.

意思大概是因为在vimrc中出现了两次filetype配置,故而引起冲突

果然,我的vimrc中

syntax on
filetype plugin on 

出现了两次!

在某个插件配置中,我又将这个配置写了一次

注释掉,问题解决~

原文地址:https://www.cnblogs.com/acbingo/p/4757275.html