diff options
Diffstat (limited to '.emacs.d/snippets')
| -rw-r--r-- | .emacs.d/snippets/python-mode/.yas-setup.el | 2 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/docstring_param | 3 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/docstring_return | 3 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/docstring_rtype | 5 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/docstring_type | 5 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/function_docstring | 8 |
6 files changed, 9 insertions, 17 deletions
diff --git a/.emacs.d/snippets/python-mode/.yas-setup.el b/.emacs.d/snippets/python-mode/.yas-setup.el index 2f52c4f..7603e4d 100644 --- a/.emacs.d/snippets/python-mode/.yas-setup.el +++ b/.emacs.d/snippets/python-mode/.yas-setup.el | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) | 14 | (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) |
| 15 | (formatted-args (mapconcat | 15 | (formatted-args (mapconcat |
| 16 | (lambda (x) | 16 | (lambda (x) |
| 17 | (concat ":param " (nth 0 x) ":\n:type " (nth 0 x) ": object\n" | 17 | (concat ":param " (nth 0 x) ":\n:type " (nth 0 x) ":\n" |
| 18 | (if (nth 1 x) (concat "\(default " (nth 1 x) "\)")))) | 18 | (if (nth 1 x) (concat "\(default " (nth 1 x) "\)")))) |
| 19 | args | 19 | args |
| 20 | indent))) | 20 | indent))) |
diff --git a/.emacs.d/snippets/python-mode/docstring_param b/.emacs.d/snippets/python-mode/docstring_param index a371d93..aa8b880 100644 --- a/.emacs.d/snippets/python-mode/docstring_param +++ b/.emacs.d/snippets/python-mode/docstring_param | |||
| @@ -2,4 +2,5 @@ | |||
| 2 | # name: docstring_param | 2 | # name: docstring_param |
| 3 | # key: P | 3 | # key: P |
| 4 | # -- | 4 | # -- |
| 5 | :param $1: $0 \ No newline at end of file | 5 | :param $1: $0 |
| 6 | :type $1: \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/docstring_return b/.emacs.d/snippets/python-mode/docstring_return index 90c05e5..4bf2f16 100644 --- a/.emacs.d/snippets/python-mode/docstring_return +++ b/.emacs.d/snippets/python-mode/docstring_return | |||
| @@ -2,4 +2,5 @@ | |||
| 2 | # name: docstring_return | 2 | # name: docstring_return |
| 3 | # key: R | 3 | # key: R |
| 4 | # -- | 4 | # -- |
| 5 | :return: $0 \ No newline at end of file | 5 | :return: $0 |
| 6 | :rtype: \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/docstring_rtype b/.emacs.d/snippets/python-mode/docstring_rtype deleted file mode 100644 index 24943bc..0000000 --- a/.emacs.d/snippets/python-mode/docstring_rtype +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: docstring_rtype | ||
| 3 | # key: RT | ||
| 4 | # -- | ||
| 5 | :rtype: $0 \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/docstring_type b/.emacs.d/snippets/python-mode/docstring_type deleted file mode 100644 index 0a9e154..0000000 --- a/.emacs.d/snippets/python-mode/docstring_type +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: docstring_type | ||
| 3 | # key: T | ||
| 4 | # -- | ||
| 5 | :type $1: $0 \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/function_docstring b/.emacs.d/snippets/python-mode/function_docstring index f372d26..685eaf5 100644 --- a/.emacs.d/snippets/python-mode/function_docstring +++ b/.emacs.d/snippets/python-mode/function_docstring | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | # NOTE: Use minimum indentation, because Emacs 25+ doesn't dedent docstrings. | 5 | # NOTE: Use minimum indentation, because Emacs 25+ doesn't dedent docstrings. |
| 6 | # -- | 6 | # -- |
| 7 | def ${1:name}($2): | 7 | def ${1:name}($2): |
| 8 | \"\"\"$3 | 8 | \"\"\"$3 |
| 9 | ${2:$(python-args-to-docstring)} | 9 | ${2:$(python-args-to-docstring)} |
| 10 | \"\"\" | 10 | \"\"\" |
| 11 | $0 \ No newline at end of file | 11 | $0 \ No newline at end of file |
