From 47da1e3e9ae19fac8b7fb8263372745bf3dfaf59 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 28 Feb 2017 09:37:43 +0100 Subject: Add a few more snippets for c-mode (null, return), cleanup for print and printf --- .emacs.d/snippets/c-mode/null | 5 +++++ .emacs.d/snippets/c-mode/print | 2 +- .emacs.d/snippets/c-mode/printf | 2 +- .emacs.d/snippets/c-mode/return | 5 +++++ .emacs.d/snippets/python-mode/function_docstring | 9 +++++---- 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 .emacs.d/snippets/c-mode/null create mode 100644 .emacs.d/snippets/c-mode/return (limited to '.emacs.d') 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 @@ +# -*- mode: snippet -*- +# name: null +# key: N +# -- +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 @@ # name: print # key: p # -- -printf("${1}"); \ No newline at end of file +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 @@ # name: printf # key: pf # -- -printf("${1:format string}"${2: ,a0,a1}); \ No newline at end of file +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 @@ +# -*- mode: snippet -*- +# name: return +# key: r +# -- +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 @@ # name: function_docstring # key: fd # group: definitions +# NOTE: Use minimum indentation, because Emacs 25+ doesn't dedent docstrings. # -- def ${1:name}($2): - \"\"\"$3 - ${2:$(python-args-to-docstring)} - \"\"\" - $0 \ No newline at end of file + \"\"\"$3 + ${2:$(python-args-to-docstring)} + \"\"\" + $0 \ No newline at end of file -- cgit v1.3