我已经开始在https://github.com/honza/vim-snippets中使用https://github.com/garbas/vim-snipmate,在让我自己的代码片段正常工作时遇到了一些问题。
我的插件是由Vundler管理的,我已经创建了一个自定义的.vim/snippets文件夹,我已经在其中放置了我自己的javascript.snippets,并且它们可以通过这个设置正确加载。
我想创建一堆更小的代码片段文件,比如:javascript.karma.snippets和javascript.angular.snippets,以帮助我更好地组织它们。我的问题是,我的代码片段不会加载,除非它们位于名为javascript.snippets的文件中。我查看了honza/vim-snippets代码库,注意到它们能够以这种方式命名片段,但我不确定如何配置我的系统以加载不同的文件名。
github存储库在FAQ中有这个,但我不知道如何检查它:
Check that your snippets file is in scope by either the filetype matching the path of the snippet file or the scope explicitly loaded.
发布于 2015-07-23 23:23:11
我再次阅读了文档,我的文件需要命名为javascript_angular.snippets才能自动加载:
From the docs:Taking "scopes" from these options, it looks in each snippets/ directory in 'runtimepath' for files named scope.snippets, scope/*.snippets, or scope_*.snippets.
https://stackoverflow.com/questions/31591618
复制相似问题