Giter VIP home page Giter VIP logo

Comments (10)

spacewander avatar spacewander commented on August 28, 2024

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

from k-vim.

tfiwits avatar tfiwits commented on August 28, 2024

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

from k-vim.

spacewander avatar spacewander commented on August 28, 2024

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

from k-vim.

wklken avatar wklken commented on August 28, 2024

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

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

确认下是否都安装成功

from k-vim.

tfiwits avatar tfiwits commented on August 28, 2024

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

from k-vim.

wklken avatar wklken commented on August 28, 2024

确认下你是否是正常安装结束
默认安装后使用应该是正常的,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']

from k-vim.

tfiwits avatar tfiwits commented on August 28, 2024

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

from k-vim.

wklken avatar wklken commented on August 28, 2024

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

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

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

from k-vim.

tfiwits avatar tfiwits commented on August 28, 2024

好的,感谢

from k-vim.

clareSun avatar clareSun commented on August 28, 2024

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

from k-vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.