简体   繁体   English

如何在Windows的$ home / vimfiles / after下创建自己的代码片段

[英]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.

相关问题 两个vimfiles目录。 我在哪里安装插件? - Two vimfiles directories. Where do I install my plugins? 如何在Windows下的PHP中获取任意*(即不是当前)用户的主目录? - How do I get the home directory of an *arbitrary* (i.e. not the current) user in PHP under Windows? 如何在我自己的窗口下捕获屏幕,不包括我自己的窗口 - How can I capture screen under my own window excluding my own window 在.NET安装执行重启后,如何强制Windows启动我自己的MSI? - How can i force Windows to start my own MSI after .NET installation performs a reboot? 如何在所有者绘制菜单中绘制自己的子菜单箭头(并防止窗口在我的顶部绘制其箭头) - How do I draw my own submenu arrow in owner draw menus (and prevent windows from painting its arrow on top of mine) 如何在Windows中编写自己的“文件系统”? - How can I write my own 'filesystem' within Windows? 如何在Windows 7 Professional下启用ctfmon.exe - How do I enable ctfmon.exe under Windows 7 Professional 有没有办法使用Windows搜索创建自己的索引? - Is there a way to create my own index with Windows Search? 如何在LGPL下编译QT以在Windows上发布? - How do I compile QT under LGPL for release on windows? 在Windows平台下,如何在cmake中使用gtk? - How do I make use of gtk with cmake under windows platform?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM