mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-12 16:34:18 +00:00
Last commit before tagging and releasing
This commit is contained in:
@@ -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}
|
||||
Reference in New Issue
Block a user