Vim: snipMate plug-in does not trigger snippet completion
Asked Answered
C

3

7

Vim is installed at /usr/share/vim.

All snipMate's folders were added to this category in existing folders (after, autoload, plugin, snippets, etc.) accordingly.

From the documentation file:

For instance, to change the trigger
key to CTRL-J, just change this:

ino <tab> <c-r>=TriggerSnippet()<cr> 
snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>

to this: 
ino <c-j> <c-r>=TriggerSnippet()<cr>  
snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>

I tried this as well - the same result. When I try to trigger snippet match it only adds a tab (4 spaces, accordingly to my .vimrc).

P.S. filetype plugin indent on.

Updated:

cat /etc/issue
Ubuntu 9.10

:inoremap

i  <C-B>       * <C-R>=TriggerSnippet()<CR>

:snoremap

s  <C-B>       * <Esc>i<Right><C-R>=TriggerSnippet()<CR>

How can I fix this?

Coth answered 14/12, 2009 at 6:21 Comment(5)
What do you get when you enter ':inoremap'? How about ':snoremap'? Does it show these mappings?Tiresias
2Peter: added. 2 Conspicuous Compiler: yes, it shows these mappings but when you use it - only additional 4 spaces have been added. Any ideas?Coth
Are you running in paste mode (no mappings would work). try :set nopasteAdulation
2michael: whey I switch to :set nopaste, this shortcut add "^B" instead of 4 spaces. What can it be?Coth
I'm confused - what key combination do you want to use to trigger snipMate? Have you changed after/plugin/snipMate.vim?Ralf
S
4

I had a problem with snipMate, it wasn't working, so I came across with Issue 66 in their Issue Tracker:

source ~/.vim/after/plugin/snipMate.vim
Silicon answered 9/6, 2010 at 14:17 Comment(5)
source $VIMRUNTIME/after/plugin/snipMate.vim at the end of file C:\Program Files\Vim\vim73\plugin\snipMate.vim worked on Windows 7Agave
@PrayagUpd I'm using newer versions of vim and snipmate, the problem disappeared. Remember that the source command has to be called inside a vimrc or gvimrc file, no in terminal.Silicon
I am using gVim 7.4 on Windows. Adding this line works, but everytime I open a file I need to do :BundleInstall first, otherwise I get an error telling me that tlib is missing.Spectator
@Guus since tlib is a dependency, you can try to call source to it's plugin file as well. I'm not having this problem so I can't test for you... :/Silicon
@SomebodystillusesyouMS-DOS I switched from Vundle to Pathogen. And installing Snipmate using Pathogen works for me right away. Thanks for the suggestion.Spectator
N
23

I solved this problem by removing the 'set paste' entry on .vimrc

Nineteen answered 4/4, 2011 at 20:59 Comment(5)
I do have a mapping for switching the paste mode, but I did not think of that as a suspect until I saw your post. Thanks.Scurrilous
Thanks Karlisson! That saved me a real headache. To see if paste is the problem, just run :set nopaste from within vi and then see if snipMate's completion starts working. Yay :)Resoluble
Ok, but is there a way to get snipMate working with set paste?Chappell
@Chappell there's a bug report code.google.com/p/snipmate/issues/detail?id=111Pfaff
If it still doesn't work for someone try - set nopasteJehol
S
4

I had a problem with snipMate, it wasn't working, so I came across with Issue 66 in their Issue Tracker:

source ~/.vim/after/plugin/snipMate.vim
Silicon answered 9/6, 2010 at 14:17 Comment(5)
source $VIMRUNTIME/after/plugin/snipMate.vim at the end of file C:\Program Files\Vim\vim73\plugin\snipMate.vim worked on Windows 7Agave
@PrayagUpd I'm using newer versions of vim and snipmate, the problem disappeared. Remember that the source command has to be called inside a vimrc or gvimrc file, no in terminal.Silicon
I am using gVim 7.4 on Windows. Adding this line works, but everytime I open a file I need to do :BundleInstall first, otherwise I get an error telling me that tlib is missing.Spectator
@Guus since tlib is a dependency, you can try to call source to it's plugin file as well. I'm not having this problem so I can't test for you... :/Silicon
@SomebodystillusesyouMS-DOS I switched from Vundle to Pathogen. And installing Snipmate using Pathogen works for me right away. Thanks for the suggestion.Spectator
C
1

In my case, I experienced the same thing. SnipMate autocomplete does not work. One of the reasons is the is used by other plugin. Typing :verbose imap <Tab> will show you which plugin that utilizes the key and cause the conflict. You can either comment out the plugin in .vimrc or you can change it to use another key.

Cherida answered 26/7, 2016 at 12:49 Comment(1)
youcompleteme plugin occupied the tab key, thanks a lot.Overlying

© 2022 - 2024 — McMap. All rights reserved.