[英]How do I create my own snippets under $home/vimfiles/after in windows
I am trying to create my own set of snippets for vim on Windows. 我正在尝试在Windows上为vim创建自己的代码片段。
As soon as I create the directory $HOME/vimfiles/after/snippets
(with or without files) the "standard" snippets (ie those that came with snipmate itself) won't be triggered anymore. 一旦创建目录$HOME/vimfiles/after/snippets
(带或不带文件),“标准”代码段(即snipmate附带的代码段)将不再被触发。
I have tried the same on a Linux installation where I was able to create a (working) set of snippets in ~/.vim/after/snippets/*.snippets
. 我曾在Linux安装上尝试过相同的方法,在该安装中,我能够在~/.vim/after/snippets/*.snippets
创建(工作)片段集。
What am I missing? 我想念什么?
Edit An answer asked if I am using the original snipmate or the fork? 编辑一个答案,问我是使用原始的狙击手还是叉子?
Answer: I was unaware of such a fork and I seem to be using the "original" one. 答:我没有意识到这样的叉子,我似乎正在使用“原始”叉子。
Edit II echo &rtp
contains C:\\Users\\Rene/vimfiles/after
(under which I created the snippets
directory). 编辑II echo &rtp
包含C:\\Users\\Rene/vimfiles/after
(在其中创建了代码snippets
目录)。
Could it be that the mixed forward backward slashes is the problem? 可能是混合正斜杠是反斜杠吗?
What SnipMate are you talking about? 您在说什么SnipMate? The original or the fork ? 原来还是叉子 ? The fork doesn't come with default snippets so you are certainly talking about the original, right? 叉子没有默认片段,所以您一定在谈论原始片段,对吧?
:help snipmate
says: :help snipmate
说:
Snippets are by default looked for any 'snippets' directory in your 'runtimepath'. 默认情况下,代码片段会在“运行时路径”中查找任何“代码片段”目录。
It's possible (but unlikely) that after
is not part of your runtimepath
… could you check with :echo &rtp
? 可能(但不太可能) after
的部分不属于运行时runtimepath
…您可以使用:echo &rtp
检查吗?
Anyway, you can use the g:snippets_dir
variable to tell SnipMate where to look for snippets: 无论如何,您可以使用g:snippets_dir
变量告诉SnipMate在哪里寻找代码片段:
let g:snippets_dir = '~/.vim/after/snippets/'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.