SnippetsEmu allows you to create TextMate-style snippets in Vim which, together with Vim’s native code-completion feature, makes Vim a top choice among lightweight text editors. When I installed Snippy (as its creator, ironically, likes to call it), I had one problem: SnippetsEmu maps its functionality to the
Open snippetsEmu.vim and find the function
s:ReturnKey. In my version, it’s on line 627. This function gets called when no snippet is found; all it does is output the tab character (or whatever key the snippets are mapped to). We want this function to output Control-P instead, since that is Vim’s native code-completion trigger. Find the line in
s:ReturnKey that looks like this:
exe "return \"".substitute(g:snippetsEmu_key, '^<', "\\\\<","")."\""
This line might have been changed in your version, so just find the line that seems to do the same thing – output
g:snippetsEmu_key. Replace that line with this:
That’s it! If that doesn’t work, all I know to do is pray. I suggest you pray to the patron saint of Damnit I Have to Learn Vim Scripting.