UltiSnips/plugin/PySnipEmu.vim

30 lines
686 B
VimL
Raw Normal View History

2009-07-04 06:15:12 -04:00
function! PyVimSnips_ExpandSnippet()
py << EOF
from PySnipEmu import PySnipSnippets
PySnipSnippets.try_expand()
EOF
return ""
endfunction
function! PyVimSnips_JumpBackwards()
py << EOF
from PySnipEmu import PySnipSnippets
PySnipSnippets.try_expand(True)
EOF
return ""
endfunction
" Expand our path
python from PySnipEmu import PySnipSnippets
inoremap <Tab> <C-R>=PyVimSnips_ExpandSnippet()<cr>
snoremap <Tab> <Esc>:call PyVimSnips_ExpandSnippet()<cr>
inoremap + <C-R>=PyVimSnips_JumpBackwards()<cr>
snoremap + <Esc>:call PyVimSnips_JumpBackwards()<cr>
au CursorMovedI * py PySnipSnippets.cursor_moved()
au InsertEnter * py PySnipSnippets.entered_insert_mode()