5

The problem with working out SnipMate under Pathogen is basically in adding new snippets, or a separate snippet bundle under the /bundles directory.

Any ideas regarding a working configuration of this problem?

Konzepz
  • 785
  • 6
  • 20
  • 1
    I use ~/.vim/bundle/snipMate/snippets/ and works fine. – Eelvex Mar 02 '11 at 09:26
  • 1
    Same as Eelvex, all the custom snippets I've added work very well. And are you sure you want to add all of scrooloose's snippets? A little bit of copypasta may be enough. – romainl Mar 02 '11 at 12:49
  • 2
    Thanks guys. Problem is, I store bundles as Git repositories (submodules), and I don't want to "contaminate" the repos with untracked files. What do I do? – Konzepz Mar 02 '11 at 21:31
  • @romainl: how did you add your custom snippets? – Neil G Apr 15 '11 at 02:31
  • @Neil G, you only need to edit the files located at `~/.vim/bundle/snipMate/snippets`. The syntax is very easy to understand. There's a little trap, though: the mandatory whitespace before each snippet is a ``, not a double-space. – romainl Apr 15 '11 at 06:54
  • @romainl: Thanks, but I'm having the same problem as Konzepz. Is there any way to put custom snippets in a separate file? – Neil G Apr 15 '11 at 16:17
  • 1
    @Neil G, you can create a snippets folder like that: `~/.vim/snippets` and put your custom snippets there, I just tried with an actionscript snippets and it worked perfectly. I think you can also do something like `~/.vim/ftplugin/javascript/snippets/javascript.snippets` but don't take my word for it. – romainl Apr 15 '11 at 21:48
  • @romainl: So, what I want is to have additional or modified cpp.snippets in `.vim/snippets` even though there's already a cpp.snippets in `.vim/bundles/.../snippets`. Do you think it will work? – Neil G Apr 15 '11 at 22:03
  • @Neil G, according to my experience, yes. However, snipMate will complain at startup if you choose the same abbreviation as in the default `cpp.snippets`. That said, editing the default `*.snippets` files is the most straightforward way. I really have no idea why it wouldn't work. Did you quit Vim? Did you reload your configuration? – romainl Apr 16 '11 at 06:43
  • @romainl: I can edit the files, but they are git submodules and I want them to be automatically updated as new versions are released using `git submodule...` I'd like to keep my overrides/custom cpp snippets separate from the downloaded versions. You are right that editing would work. – Neil G Apr 16 '11 at 06:52
  • 1
    @Neil G Then the `~/.vim/snippets/cpp.snippets` road seems to be the best: you won't have conflicts when updating your bundles. Another way would be to explicitly `git ignore` the files you have edited. – romainl Apr 16 '11 at 09:52
  • Maybe add this as an answer guys? – slotishtype Jul 19 '11 at 09:29
  • Check this out... seems to be what you want. http://superuser.com/questions/402617/snipmate-pathogen-git-custom-snippets-dont-work-on-windows –  Mar 29 '13 at 15:52

2 Answers2

2

By default snipMate looks for snippets in ~/.vim/snippets so just put your new snippets files there or change the g:snippets_dir variable in Vim to any directory you want.

I have let g:snippets_dir = "~/.vim/snippets" in my vimrc file so snipMate only looks at my custom snippets files. If you want both then just use the defaults + the ~/.vim/snippets directory.

ggustafsson
  • 1,964
  • 15
  • 20
0

For pathogen, you can simple use git and add a submodule liket his:

 git submodule add https://github.com/garbas/vim-snipmate ~/.vim/bundle/snipmate

Check out garab's vim-snipmate github.

Tamara Wijsman
  • 57,083
  • 27
  • 185
  • 256
juanpablo
  • 6,966
  • 11
  • 52
  • 72