Replaced space indent through tab indent in snippets. This is more logical now that expandtab is adhered to

This commit is contained in:
Holger Rapp 2009-07-29 22:46:11 +02:00
parent 22804a2cbb
commit 51f462bbde
3 changed files with 30 additions and 30 deletions

View File

@ -9,13 +9,13 @@ snippet box "A nice box with the current comment symbol" b
c = '#'
cs = vim.eval("&commentstring")
if len(cs) == 3:
c = cs[0]
c = cs[0]
res = (len(t[1])+4)*c + '\n' + c + ' '`${1:content}`!p
c = '#'
cs = vim.eval("&commentstring")
if len(cs) == 3:
c = cs[0]
c = cs[0]
res = ' ' + c + '\n' + (len(t[1])+4)*c`
$0
@ -26,14 +26,14 @@ snippet bbox "A nice box over the full width" b
c = '#'
cs = vim.eval("&commentstring")
if len(cs) == 3:
c = cs[0]
c = cs[0]
res = 75*c + '\n' + c + " "+ (71-len(t[1]))/2*' '
`${1:content}`!p
c = '#'
cs = vim.eval("&commentstring")
if len(cs) == 3:
c = cs[0]
c = cs[0]
a = 71-len(t[1]); res = (a/2 + a%2) * " " + " " + c + '\n' + 75*c`
$0

View File

@ -11,7 +11,7 @@ endsnippet
snippet ifmain "ifmain" b
if __name__ == '__main__':
${1:main()}$0
${1:main()}$0
endsnippet
@ -20,13 +20,13 @@ endsnippet
##########
snippet class "smart class" b
class ${1:MyClass}(${2:object}):
"""${3:Docstring for $1}"""
"""${3:Docstring for $1}"""
def __init__( self${4/([^,])?(.*)/(?1:, )/}${4:arg} ):
"""
TODO: Fill me in
${4/.+/(?0:\n)/}${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][A-Za-z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2: $2 - describe me here\n)/g} """
${2/object$|(.+)/(?1: $0.__init__\(self\)\n\n)/}${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][A-Za-z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2: self._$2 = $2\n)/g}
def __init__( self${4/([^,])?(.*)/(?1:, )/}${4:arg} ):
"""
TODO: Fill me in
${4/.+/(?0:\n)/}${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][A-Za-z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:\t\t$2 - describe me here\n)/g}\t\t"""
${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}
endsnippet
snippet .
@ -43,16 +43,16 @@ endsnippet
snippet roprop "Read Only Property" b
@property
def ${1:property}(self):
${2:return self._$1}$0
${2:return self._$1}$0
endsnippet
snippet rwprop "Read write property" b
def ${1:property}():
${2/.+/(?0:""")/}${2:The RW property $1}${2/.+/(?0:"""\n )/}def fget(self):
return self._$1$0
def fset(self, value):
self._$1 = value
return locals()
${2/.+/(?0:""")/}${2:The RW property $1}${2/.+/(?0:"""\n\t\t)/}def fget(self):
return self._$1$0
def fset(self, value):
self._$1 = value
return locals()
$1 = property(**$1())
endsnippet
@ -61,38 +61,38 @@ endsnippet
##########################
snippet try "Try / Except" b
try:
${1:pass}
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
${4:raise $3}
endsnippet
snippet try "Try / Except / Else" b
try:
${1:pass}
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
${4:raise $3}
else:
${5:pass}
${5:pass}
endsnippet
snippet try "Try / Except / Finally" b
try:
${1:pass}
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
${4:raise $3}
else:
${5:pass}
${5:pass}
endsnippet
snippet try "Try / Except / Else / Finally" b
try:
${1:pass}
${1:pass}
except${2: ${3:Exception}, ${4:e}}:
${5:raise}
${5:raise}
else:
${6:pass}
${6:pass}
finally:
${7:pass}
${7:pass}
endsnippet
##############

View File

@ -12,7 +12,7 @@ endsnippet
snippet gvar "Global / configuration variable"
if !exists("g:${1:MyUltraImportantVar}")
let g:$1 = ${2:"${3:<tab>}"}
let g:$1 = ${2:"${3:<tab>}"}
endif
endsnippet