VIM - how to work with BOTH supertab.vim with snipMate.vim?

4

2

I'm picking up vim and found 2 plugins that work great - snipMate, that mimics the textmate's snippet behavior and supertab, that toggles and completes words using the tab key based on exiting words in current/other buffers. I've turned all plugins on in my .vimrc file using :filetype plugin on, but I can only get supertab to work. I suspect that since the TAB key is used for both, they are overriding each other. Has anyone encountered this and found a fix? I'm not an expert yet on editing my .vimrc file, mapping keys, etc. Thanks.

EDIT

When I try to force load snipMate.vim alone, I get the following errors:

Error detected while processing /home/sa125/.vim/plugin/snipMate.vim:
line   15:
E122: Function <SNR>18_RemoveSnippet already exists, add ! to replace it
line   73:
E122: Function snipMate#expandSnip already exists, add ! to replace it
line  112:
E122: Function <SNR>18_ProcessSnippet already exists, add ! to replace it
line  123:
E122: Function <SNR>18_Count already exists, add ! to replace it
line  169:
E122: Function <SNR>18_BuildTabStops already exists, add ! to replace it
line  211:
E122: Function snipMate#jumpTabStop already exists, add ! to replace it
line  258:
E122: Function <SNR>18_UpdatePlaceholderTabStops already exists, add ! to replace it
line  302:
E122: Function <SNR>18_UpdateTabStops already exists, add ! to replace it
line  321:
E122: Function <SNR>18_SelectWord already exists, add ! to replace it
line  385:
E122: Function <SNR>18_UpdateChangedSnip already exists, add ! to replace it
line  434:
E122: Function <SNR>18_UpdateVars already exists, add ! to replace it  

Am I doing it wrong?...

sa125

Posted 2010-08-05T07:02:30.910

Reputation: 916

i have the same problem but the other way round. i only get snipmate to work but not supertab. both work standalone – matthias krull – 2010-08-10T13:49:42.017

what version of vim are you using? what OS? What other plugins do you use? – matthias krull – 2010-08-10T14:49:10.597

Answers

4

Ok i got it working with the scripts linked in the original question.

It turned out that i used supersnipmate, a snipmate fork, that unfortunately removed the builtin supertab support of snipmate.

Also i did use the original supertab hosted on vim.org that did not work with snipmate as well. The linked script on github turned out to be the successor (or continued version) of the old supertab.

matthias krull

Posted 2010-08-05T07:02:30.910

Reputation: 2 394

6

I have both working well together.

The only relevant line in my .vimrc is:

let g:SuperTabDefaultCompletionType = "context"

sml

Posted 2010-08-05T07:02:30.910

Reputation: 1 582