2

I've been trying to get snippets to work with Vim (specifically, MacVim). I have tried both snippetsEmu and snipMate (preferred). Other plugins are working fine.

I have been able to get snippetsEmu to temporarily work via A Byte of Vim's note to run :runtime! ftplugin/python_snippets.vim if they aren't working, except the author doesn't mention why they may not be working or what kind of permanent solutions are available.

So, basically when I type for<tab> in a PHP file it just puts a tab after 'for' instead of expanding into the snippet. I'm new to Vim and can't seem to figure this out. The only main difference that these two plugins (snippetsEmu and snipMate) have compared to other plugins is that they use the ~/.vim/after directory. But knowing that hasn't helped me any.

What I have seen some people suggest is to make sure the following is in your .vimrc file, but this has not helped:

set nocompatible
filetype on
filetype plugin on

4 Answers 4

2

Turns out I had left the folder ~/.vim/after/ftplugin from when I installed snippetsEmu and put one of snipMate's files in there instead of where it was supposed to go, ~/.vim/after/plugin. And here I was assuming I had installed everything correctly. Sorry to have wasted anyone's time who may have looked over this. I still don't know why snippetsEmu didn't work, but I don't feel like messing with it as it seems to have been abandoned and lacking the features that snipMate has.

1

I had this problem too (with gvim on Win32), but for me, it turned out that the "after" directory wasn't on the runtime path.

set runtimepath=$VIMRUNTIME,c:/Users/$USERNAME/_vim/after

Seemed to sort it out...

1

I had the following line in my .vimrc:

:set paste 

Commenting that line out made snipMate work just fine.

1

I solved this problem by removing the set paste from .vimrc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .