2009-06-23 08:45:04 -04:00
|
|
|
pyfile PySnipEmu.py
|
|
|
|
|
|
|
|
|
|
|
|
function! PyVimSnips_ExpandSnippet()
|
|
|
|
py << EOF
|
|
|
|
from PySnipEmu import PySnipSnippets
|
|
|
|
PySnipSnippets.try_expand()
|
|
|
|
EOF
|
|
|
|
|
|
|
|
return ""
|
|
|
|
endfunction
|
|
|
|
|
2009-07-01 14:03:29 -04:00
|
|
|
function! PyVimSnips_JumpBackwards()
|
|
|
|
py << EOF
|
|
|
|
from PySnipEmu import PySnipSnippets
|
|
|
|
PySnipSnippets.try_expand(True)
|
|
|
|
EOF
|
|
|
|
return ""
|
|
|
|
endfunction
|
|
|
|
|
2009-06-28 08:51:27 -04:00
|
|
|
|
|
|
|
function! PyVimSnips_SelectWord(len)
|
|
|
|
return "\<esc>".'v'.a:len."l\<c-g>"
|
|
|
|
endf
|
|
|
|
|
2009-06-23 08:45:04 -04:00
|
|
|
" Run the unit test suite that comes
|
|
|
|
" with the application
|
|
|
|
function! PyVimSnips_RunTests()
|
|
|
|
pyfile test.py
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
python from PySnipEmu import PySnipSnippets
|
|
|
|
|
|
|
|
inoremap <Tab> <C-R>=PyVimSnips_ExpandSnippet()<cr>
|
2009-06-28 16:22:19 -04:00
|
|
|
snoremap <Tab> <Esc>:call PyVimSnips_ExpandSnippet()<cr>
|
2009-07-01 14:03:29 -04:00
|
|
|
inoremap + <C-R>=PyVimSnips_JumpBackwards()<cr>
|
|
|
|
snoremap + <Esc>:call PyVimSnips_JumpBackwards()<cr>
|
2009-06-23 08:45:04 -04:00
|
|
|
|
2009-06-28 16:22:19 -04:00
|
|
|
au CursorMovedI * py PySnipSnippets.cursor_moved()
|
|
|
|
au InsertEnter * py PySnipSnippets.entered_insert_mode()
|
|
|
|
|
2009-06-23 08:45:04 -04:00
|
|
|
|