"" FUNCTIONS function! PyVimSnips_ExpandSnippet() if exists('g:SuperTabMappingForward') if g:SuperTabMappingForward == "" let SuperTabKey = "\" elseif g:SuperTabMappingBackward == "" let SuperTabKey = "\" endif endif if pumvisible() " Update snippet if completion is used, or deal with supertab if exists('SuperTabKey') call feedkeys(SuperTabKey) | return '' endif call feedkeys("\a", 'n') " Close completion menu call feedkeys("\") | return '' endif " Now, really expand something py << EOF if not PySnipSnippets.try_expand(): vim.command("""if exists('SuperTabKey') call feedkeys(SuperTabKey) endif """) EOF return "" endfunction function! PyVimSnips_JumpBackwards() py << EOF from PySnipEmu import PySnipSnippets PySnipSnippets.try_expand(True) EOF return "" endfunction "" STARTUP CODE " Expand our path python << EOF import vim, os, sys for p in vim.eval("&runtimepath").split(','): dname = p + os.path.sep + "plugin" if os.path.exists(dname + os.path.sep + "PySnipEmu.py"): if dname not in sys.path: sys.path.append(dname) break from PySnipEmu import PySnipSnippets EOF inoremap =PyVimSnips_ExpandSnippet() snoremap :call PyVimSnips_ExpandSnippet() inoremap =PyVimSnips_JumpBackwards() snoremap :call PyVimSnips_JumpBackwards() snoremap :py PySnipSnippets.backspace() au CursorMovedI * py PySnipSnippets.cursor_moved() au InsertEnter * py PySnipSnippets.entered_insert_mode()