Question

Like the subject, i found linux solution:

https://stackoverflow.com/a/8103835

but on windows this apparently doesn't work. When added file "c:\Program Files\Vim\vimfiles\snippets\javascript.snippets", all js snippets didn't work.

Was it helpful?

Solution

Ok there is a path issue on Windows or something because of this:

  1. my default variable (without ingerention to $myvimrc) g:snippets_dir is"C:\Documents and Settings\xliiv\vimfiles\snippets\,C:\Documents and Settings\xliiv\vimfiles\bundle\snipmate\snippets\" and both snippets (plugin and my defines) dosn't work.

but after setting it with additonal escapings in $myvimrc like this:

let g:snippets_dir="C:\\Documents and Settings\\xliiv\\vimfiles\\snippets,C:\\Documents and Settings\\xliiv\\vimfiles\\bundle\\snipmate\\snippets"

(the same as '1.' but with doubled '\') both WORKS perfect.

So my lateset WORKING line from $myvimrc is this: let g:snippets_dir="$HOME\vimfiles\snippets,$HOME\vimfiles\bundle\snipmate\snippets"

OTHER TIPS

It's not a good idea to store your plugins in c:\Program Files\Vim\vimfiles\, specially if your machine can be shared with other users. You should put them in C:\Users\[your name here]\vimfiles\.

Do you use SnipMate?

Assuming "yes" and since you appear to be using Pathogen, the correct location for SnipMate is C:\Users\[your name here]\vimfiles\bundle\snipmate.

Next time you edit a .js file all the default JavaScript snippets will be available.

Regarding the location of your snippets everything is explained in :help snipmate: if you have your own custom snippets you are supposed to put them under C:\Users\[your name here]\vimfiles\snippets\ which is their default location.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top