Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于UltiSnips替换snippets #32

Closed
tfiwits opened this issue May 10, 2014 · 10 comments
Closed

关于UltiSnips替换snippets #32

tfiwits opened this issue May 10, 2014 · 10 comments

Comments

@tfiwits
Copy link

tfiwits commented May 10, 2014

请问UltiSnips如何指定要使用哪一个.snippets呢(?)
预设好像是all.snippets,谢谢

@spacewander
Copy link
Contributor

根据后缀名,比如后缀名是sh就会加载sh.snippets

@tfiwits
Copy link
Author

tfiwits commented May 10, 2014

你好,我刚试了一下我只有将all.snippets直接替换成比如c.snippets才会有补全效果

@spacewander
Copy link
Contributor

准确来说不是后缀名……而是Vim所识别的filetype,如果filetype是c的话,就会加载c.snippets

@wklken
Copy link
Owner

wklken commented May 10, 2014

UltiSnips这个,配置了一份snippets集合 https://github.com/honza/vim-snippets

里面有对应代码片段,默认会自动加载对应类型的文件
all.snippets对所有类型文件生效

确认下是否都安装成功

@tfiwits
Copy link
Author

tfiwits commented May 10, 2014

恩...我想我都有安装成功,filetype类型检测也确认打开了,也手动设置过,不管filetype是什么,它好像只会加载all.snippets,其他的.snippets都没有加载的样子

@wklken
Copy link
Owner

wklken commented May 11, 2014

确认下你是否是正常安装结束
默认安装后使用应该是正常的,python/golang等都正常
c的我也测试过,例如输入def按自动转#define

有没有改了什么配置?

" 代码片段快速插入
Bundle 'SirVer/ultisnips'
" 代码片段资源,需要学习
" Snippets are separated from the engine. Add this if you want them:
Bundle 'honza/vim-snippets'
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
" 定义存放代码片段的文件夹 .vim/additional_snippets下,使用自定义和默认的,将会的到全局,有冲突的会提示
let g:UltiSnipsSnippetDirectories=["additional_snippets", 'UltiSnips']

@tfiwits
Copy link
Author

tfiwits commented May 11, 2014

刚刚重新安装了一次,确认安装成功,配置是相同的,不过还是不会正常加载应该加载的类型,另外请问一下
let g:UltiSnipsSnippetDirectories=["additional_snippets", 'UltiSnips']中的"additional_snippets"为代码片段的文件夹那第二个'UltiSnips'指的是什么呢(?)

@wklken
Copy link
Owner

wklken commented May 12, 2014

会将.vim目录下所有名字叫"additional_snippets", 'UltiSnips' 的目录下的文件加载进来

去看下 UltiSnips 插件的文档吧,看能不能解决

搞不定的话,换snipmate这个插件试试

@tfiwits
Copy link
Author

tfiwits commented May 12, 2014

好的,感谢

@wklken wklken closed this as completed May 26, 2014
@clareSun
Copy link

遇到同样的问题,不知道是否已经解决

andyt9527 pushed a commit to andyt9527/vim_config that referenced this issue Jul 17, 2020
add plugin ctrlp-py-matcher to unite layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants