From 51f462bbde0dd5d8ad7c7f3ca3223d5403c423e6 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Wed, 29 Jul 2009 22:46:11 +0200 Subject: [PATCH] Replaced space indent through tab indent in snippets. This is more logical now that expandtab is adhered to --- UltiSnips/all.snippets | 8 +++---- UltiSnips/python.snippets | 50 +++++++++++++++++++-------------------- UltiSnips/vim.snippets | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/UltiSnips/all.snippets b/UltiSnips/all.snippets index c7d766b..62c56f4 100644 --- a/UltiSnips/all.snippets +++ b/UltiSnips/all.snippets @@ -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 diff --git a/UltiSnips/python.snippets b/UltiSnips/python.snippets index 61e6c08..f653db3 100644 --- a/UltiSnips/python.snippets +++ b/UltiSnips/python.snippets @@ -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 ############## diff --git a/UltiSnips/vim.snippets b/UltiSnips/vim.snippets index ece1d72..28d38b1 100644 --- a/UltiSnips/vim.snippets +++ b/UltiSnips/vim.snippets @@ -12,7 +12,7 @@ endsnippet snippet gvar "Global / configuration variable" if !exists("g:${1:MyUltraImportantVar}") - let g:$1 = ${2:"${3:}"} + let g:$1 = ${2:"${3:}"} endif endsnippet