Added missing files

This commit is contained in:
Holger Rapp 2009-07-04 12:15:12 +02:00
parent 1d5a81b0c3
commit b0653645e9
3 changed files with 47 additions and 0 deletions

9
PySnippets/all.snippets Normal file
View File

@ -0,0 +1,9 @@
# This is a comment, don't read it
snippet hallo "This is my cool description"
Hallo Welt
endsnippet
snippet db
debug(${1/ba/arg, /} ${1:args})
endsnippet

View File

@ -0,0 +1,9 @@
snippet cls
class ${1:MyClass}(${2:object}):
def __init__( self${4/([^,])?(.*)/(?1:, )/}${4:arg} ):
"""
TODO: Fill me in
"""
${2/object$|(.+)/(?1:\t\t$0.__init__\(self\)\n\n)/}${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][A-Za-z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:\t\tself._$2 = $2\n)/g} $0
endsnippet

29
plugin/PySnipEmu.vim Normal file
View File

@ -0,0 +1,29 @@
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()