mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-11 16:04:17 +00:00
Last commit before tagging and releasing
This commit is contained in:
0
extras/imported/python-mode/.yas-make-groups
Normal file
0
extras/imported/python-mode/.yas-make-groups
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: class
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: New Class
|
||||
# --
|
||||
class ${1:ClassName}(${2:object}):
|
||||
${3/.+/"""/}${3:docstring for $1}${3/.+/"""\n/}${3/.+/\t/}def __init__(self${4/([^,])?(.*)/(?1:, )/}${4:arg}):
|
||||
${5:super($1, self).__init__()}
|
||||
${4/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][a-zA-Z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:\t\tself.$2 = $2\n)/g} $0
|
||||
@@ -0,0 +1,12 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: def
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: New Function
|
||||
# --
|
||||
def ${1:fname}(${2:`if [ "$TM_CURRENT_LINE" != "" ]
|
||||
# poor man's way ... check if there is an indent or not
|
||||
# (cuz we would have lost the class scope by this point)
|
||||
then
|
||||
echo "self"
|
||||
fi`}):
|
||||
${3/.+/"""/}${3:docstring for $1}${3/.+/"""\n/}${3/.+/\t/}${0:pass}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: defs
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: New Method
|
||||
# --
|
||||
def ${1:mname}(self${2/([^,])?.*/(?1:, )/}${2:arg}):
|
||||
${3:pass}
|
||||
15
extras/imported/python-mode/Idioms/New Property.yasnippet
Normal file
15
extras/imported/python-mode/Idioms/New Property.yasnippet
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: property
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: New Property
|
||||
# --
|
||||
def ${1:foo}():
|
||||
doc = "${2:The $1 property.}"
|
||||
def fget(self):
|
||||
${3:return self._$1}
|
||||
def fset(self, value):
|
||||
${4:self._$1 = value}
|
||||
def fdel(self):
|
||||
${5:del self._$1}
|
||||
return locals()
|
||||
$1 = property(**$1())$0
|
||||
9
extras/imported/python-mode/Idioms/Try:Except.yasnippet
Normal file
9
extras/imported/python-mode/Idioms/Try:Except.yasnippet
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: try
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Try/Except
|
||||
# --
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
11
extras/imported/python-mode/Idioms/Try:Except:Else.yasnippet
Normal file
11
extras/imported/python-mode/Idioms/Try:Except:Else.yasnippet
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: try
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Try/Except/Else
|
||||
# --
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
else:
|
||||
${5:pass}
|
||||
@@ -0,0 +1,13 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: try
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Try/Except/Else/Finally
|
||||
# --
|
||||
try:
|
||||
${1:pass}
|
||||
except${2: ${3:Exception}, ${4:e}}:
|
||||
${5:raise}
|
||||
else:
|
||||
${6:pass}
|
||||
finally:
|
||||
${7:pass}
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: try
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Try/Except/Finally
|
||||
# --
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
finally:
|
||||
${5:pass}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: ifmain
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: if __name__ == '__main__'
|
||||
# --
|
||||
if __name__ == '__main__':
|
||||
${1:main()}$0
|
||||
6
extras/imported/python-mode/Insert/__magic__.yasnippet
Normal file
6
extras/imported/python-mode/Insert/__magic__.yasnippet
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: __
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: __magic__
|
||||
# --
|
||||
__${1:init}__
|
||||
6
extras/imported/python-mode/Insert/self.yasnippet
Normal file
6
extras/imported/python-mode/Insert/self.yasnippet
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: .
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: self
|
||||
# --
|
||||
self.
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Inside Class Def: Insert (..):
|
||||
# binding: "("
|
||||
# --
|
||||
(${0:object}):
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Inside Function Def: Insert (..):
|
||||
# binding: "("
|
||||
# --
|
||||
($0):
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Inside String: Insert "…"
|
||||
# binding: """
|
||||
# --
|
||||
"$0"
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Inside String: Insert '…'
|
||||
# binding: "'"
|
||||
# --
|
||||
'$0'
|
||||
Reference in New Issue
Block a user