开发者

SnipMate with Pathogen

开发者 https://www.devze.com 2023-04-01 01:35 出处:网络
I\'ve just installed pathogen on 开发者_开发问答my ~/.vim and add the new command to run the bundles

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


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.


I don't now why but when I remove the option

set paste 

from my .vimrc the snipmate pluging start work perfectly.


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.


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()
0

精彩评论

暂无评论...
验证码 换一张
取 消