diff options
| author | Simeon Simeonov | 2017-02-28 09:37:43 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2017-02-28 09:37:43 +0100 |
| commit | 47da1e3e9ae19fac8b7fb8263372745bf3dfaf59 (patch) | |
| tree | 6ea67663b8f638ac3da2cd17418319f510456b41 /.emacs.d | |
| parent | 76a5d73336f125de166c111b1d3e637d122d65ca (diff) | |
Add a few more snippets for c-mode (null, return), cleanup for print and printf
Diffstat (limited to '.emacs.d')
| -rw-r--r-- | .emacs.d/snippets/c-mode/null | 5 | ||||
| -rw-r--r-- | .emacs.d/snippets/c-mode/print | 2 | ||||
| -rw-r--r-- | .emacs.d/snippets/c-mode/printf | 2 | ||||
| -rw-r--r-- | .emacs.d/snippets/c-mode/return | 5 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/function_docstring | 9 |
5 files changed, 17 insertions, 6 deletions
diff --git a/.emacs.d/snippets/c-mode/null b/.emacs.d/snippets/c-mode/null new file mode 100644 index 0000000..525fc57 --- /dev/null +++ b/.emacs.d/snippets/c-mode/null | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: null | ||
| 3 | # key: N | ||
| 4 | # -- | ||
| 5 | NULL \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/c-mode/print b/.emacs.d/snippets/c-mode/print index 4b56128..1ae9dcd 100644 --- a/.emacs.d/snippets/c-mode/print +++ b/.emacs.d/snippets/c-mode/print | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | # name: print | 2 | # name: print |
| 3 | # key: p | 3 | # key: p |
| 4 | # -- | 4 | # -- |
| 5 | printf("${1}"); \ No newline at end of file | 5 | printf("$0"); \ No newline at end of file |
diff --git a/.emacs.d/snippets/c-mode/printf b/.emacs.d/snippets/c-mode/printf index 9c2c0ef..a92b122 100644 --- a/.emacs.d/snippets/c-mode/printf +++ b/.emacs.d/snippets/c-mode/printf | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | # name: printf | 2 | # name: printf |
| 3 | # key: pf | 3 | # key: pf |
| 4 | # -- | 4 | # -- |
| 5 | printf("${1:format string}"${2: ,a0,a1}); \ No newline at end of file | 5 | printf("${1:format string}"$2); \ No newline at end of file |
diff --git a/.emacs.d/snippets/c-mode/return b/.emacs.d/snippets/c-mode/return new file mode 100644 index 0000000..70751a2 --- /dev/null +++ b/.emacs.d/snippets/c-mode/return | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: return | ||
| 3 | # key: r | ||
| 4 | # -- | ||
| 5 | return $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 1f7f35b..f372d26 100644 --- a/.emacs.d/snippets/python-mode/function_docstring +++ b/.emacs.d/snippets/python-mode/function_docstring | |||
| @@ -2,9 +2,10 @@ | |||
| 2 | # name: function_docstring | 2 | # name: function_docstring |
| 3 | # key: fd | 3 | # key: fd |
| 4 | # group: definitions | 4 | # group: definitions |
| 5 | # NOTE: Use minimum indentation, because Emacs 25+ doesn't dedent docstrings. | ||
| 5 | # -- | 6 | # -- |
| 6 | def ${1:name}($2): | 7 | def ${1:name}($2): |
| 7 | \"\"\"$3 | 8 | \"\"\"$3 |
| 8 | ${2:$(python-args-to-docstring)} | 9 | ${2:$(python-args-to-docstring)} |
| 9 | \"\"\" | 10 | \"\"\" |
| 10 | $0 \ No newline at end of file | 11 | $0 \ No newline at end of file |
