diff --git a/etc/yasnippet/snippets/python-mode/base_class b/etc/yasnippet/snippets/python-mode/base_class new file mode 100644 index 0000000..d6b575b --- /dev/null +++ b/etc/yasnippet/snippets/python-mode/base_class @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Uses .yas-setup.el. +# name : base class +# key : bcls +# expand-env: ((yas-indent-line 'fixed)) +# -- +class ${1:ClassName}: + """${2:XXX}.${3:$(python-arguments-to-doc-string)}""" + + def __init__(self, $3): + ${3:$(python-arguments-to-self-init-string)}$0pass + diff --git a/etc/yasnippet/snippets/python-mode/def_function b/etc/yasnippet/snippets/python-mode/def_function new file mode 100644 index 0000000..e5dcf18 --- /dev/null +++ b/etc/yasnippet/snippets/python-mode/def_function @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# Uses .yas-setup.el. +# name : def function +# key : deff +# -- +def ${1:name}($2): + """${3:XXX.}${2:$(python-arguments-to-doc-string)}""" + $0pass diff --git a/etc/yasnippet/snippets/python-mode/def_method b/etc/yasnippet/snippets/python-mode/def_method new file mode 100644 index 0000000..628ed2c --- /dev/null +++ b/etc/yasnippet/snippets/python-mode/def_method @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Uses .yas-setup.el. +# name : def method +# key : defm +# -- +def ${1:name}(self$2): + """${3:XXX.}${2:$(python-arguments-to-doc-string)}""" + $0pass + diff --git a/etc/yasnippet/snippets/python-mode/derived_class b/etc/yasnippet/snippets/python-mode/derived_class new file mode 100644 index 0000000..f2ade62 --- /dev/null +++ b/etc/yasnippet/snippets/python-mode/derived_class @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Uses .yas-setup.el. +# name : derived class +# key : dcls +# expand-env: ((yas-indent-line 'fixed)) +# -- +class ${1:ClassName}(${2:object}): + """${3:XXX}.${4:$(python-arguments-to-doc-string)}""" + + def __init__(self, $4): + ${4:$(python-arguments-to-self-init-string)}$0pass + diff --git a/etc/yasnippet/snippets/python-mode/program b/etc/yasnippet/snippets/python-mode/program new file mode 100644 index 0000000..7229860 --- /dev/null +++ b/etc/yasnippet/snippets/python-mode/program @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# name : program +# key : program +# expand-env : ((yas-indent-line 'fixed)) +# -- +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""${1:XXX}.""" + +import numpy + + +def main(): + """${2:XXX}.""" + $0pass + + +if __name__ == '__main__': + main() + +# Local Variables: +# mode: python +# End: diff --git a/etc/yasnippet/snippets/python-ts-mode/.yas-parents b/etc/yasnippet/snippets/python-ts-mode/.yas-parents new file mode 100644 index 0000000..f4438bd --- /dev/null +++ b/etc/yasnippet/snippets/python-ts-mode/.yas-parents @@ -0,0 +1,2 @@ +python-mode +