Search code examples
windowsvimcode-snippetssnipmatepathogen

Where to put my snippets on windows having vim with pathogen?


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.


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"