SnipMate with Pathogen

十年热恋 提交于 2019-12-07 02:36:15

问题


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:

  1. You forgot to install some dependencies. In this case it is likely that some errors will be thrown.
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!