Here is my setup:
- My .vim directory is under source control with git
- I use Pathogen for managing my plugins
- My SnipMate plugin is a git submodule under
.vim/bundle/snipmate
This means I can't really edit the snippets in .vim/bundle/snipmate/snippets
because they are not tracked. I have discovered that I can define my own custom snippets in .vim/snippets
, or create a new directory .vim/bundle/snipmate-custom/snippets/
and define them there.
This works beautifully on linux. For example I can have the original file html.snippets
in .vim/bundle/snipmate/snippets
and my own html.snippets
in .vim/snippets/
and vim will use both files.
On Windows I have noticed that creating another snippets directory (either in .vim/snippets/
or in .vim/bundle/snipmate-custom/snippets/
breaks the plugin. The tab completion no longer works - it ignores both the original snippets that came with the plugin, and the ones in the new repository.
Any idea why this is happening?
I'm running Vista, and I my vim config is in %USERPROFILE%\.vim
. I have vimfiles folder symlinked to that directory using:
mklink /d vimfiles .vim
Every other plugin works. Shipmate works perfectly provided the .vim/snippets
directory does not exist. The above setup works fine on Ubuntu and on Mac. Any idea why it breaks on Windows?
EDIT
I might have answered my own question. I managed to work around this problem by explicitly telling snipmate which directories to use:
if has('win32')
let g:snippets_dir="c:/Users/me/.vim/bundle/snipmate/snippets/,
c:/Users/me/.vim/bundle/snipmate-custom/snippets"
endif
Not the most elegant solution, but it works. Let me know if you figure out a better way to do this.
Answer
I have answered my own question. I managed to work around this problem by explicitly telling snipmate which directories to use:
if has('win32')
let g:snippets_dir="c:/Users/me/.vim/bundle/snipmate/snippets/,
c:/Users/me/.vim/bundle/snipmate-custom/snippets"
endif
No comments:
Post a Comment