问题
I've just installed pathogen on my ~/.vim
and add the new command to run the bundles
:call pathogen#infect()
I've already add to my ~/.vim/bundle
folder vim-surround and NERDtree and everything works great. Nevertheless, when I tried to add garbas SnipMate it didn't work. Could someone help with this issue? Thanks
回答1:
I installed snimpmate following this guide with no problem at all John Andersons vim guide
$ mkdir ~/.vim/
$ mkdir ~/.vim/{autoload,bundle}
$ cd ~/.vim/
$ git init
git submodule add https://github.com/msanders/snipmate.vim.git bundle/snipmate
To create your own snippets
$ mkdir ~/.vim/snippets
$ vim ~/.vim/snippets/python.snippets
His example for pdb snippet
snippet pdb
import pdb; pdb.set_trace()
You should be then good to go.
回答2:
I don't now why but when I remove the option
set paste
from my .vimrc the snipmate pluging start work perfectly.
回答3:
The official way of snipmate distribution is vim-addon-manager. Like pathogen it puts each plugin in a separate folder, but it also does more, see the documentation. I have not tried pathogen at all, but I know what may be the cause here:
- You forgot to install some dependencies. In this case it is likely that some errors will be thrown.
- Pathogen is not sourcing
after/
directory (and vim won't do this for all &runtimepath items, just for a few as documented in:h after-directory
). As far as I know all mappings are located there.
回答4:
This is not obvious, but snippets/
directory must be at .vim/
.
$ mkdir ~/.vim/snippets
$ vim ~/.vim/snippets/python.snippets
At least one snippet:
snippet pdb
import pdb; pdb.set_trace()
来源:https://stackoverflow.com/questions/7232425/snipmate-with-pathogen