From dd3dff6eebcd8fb14d8ba9b0666365bea62e5d81 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 3 Feb 2016 21:53:13 +0100 Subject: Add own snippets --- snippets/c++-mode/#i.yasnippet | 4 ++++ snippets/c++-mode/local-#i.yasnippet | 5 +++++ snippets/c-mode/fopen | 3 +++ snippets/delphi-mode/begin ... end.yasnippet | 8 ++++++++ snippets/delphi-mode/class (class).yasnippet | 8 ++++++++ snippets/delphi-mode/constructor, destructor.yasnippet | 9 +++++++++ snippets/delphi-mode/dbg.yasnippet | 6 ++++++ snippets/delphi-mode/for ... end.yasnippet | 9 +++++++++ snippets/delphi-mode/func-prototype.yasnippet | 8 ++++++++ snippets/delphi-mode/func.yasnippet | 10 ++++++++++ snippets/delphi-mode/if ... end.yasnippet | 9 +++++++++ snippets/delphi-mode/procedure-prototype.yasnippet | 8 ++++++++ snippets/delphi-mode/procedure.yasnippet | 10 ++++++++++ snippets/delphi-mode/try ... finally.yasnippet | 10 ++++++++++ snippets/erlang-mode/inc.lib | 4 ++++ snippets/text-mode/email | 3 +++ snippets/text-mode/time | 3 +++ 17 files changed, 117 insertions(+) create mode 100644 snippets/c++-mode/#i.yasnippet create mode 100644 snippets/c++-mode/local-#i.yasnippet create mode 100644 snippets/c-mode/fopen create mode 100644 snippets/delphi-mode/begin ... end.yasnippet create mode 100644 snippets/delphi-mode/class (class).yasnippet create mode 100644 snippets/delphi-mode/constructor, destructor.yasnippet create mode 100644 snippets/delphi-mode/dbg.yasnippet create mode 100644 snippets/delphi-mode/for ... end.yasnippet create mode 100644 snippets/delphi-mode/func-prototype.yasnippet create mode 100644 snippets/delphi-mode/func.yasnippet create mode 100644 snippets/delphi-mode/if ... end.yasnippet create mode 100644 snippets/delphi-mode/procedure-prototype.yasnippet create mode 100644 snippets/delphi-mode/procedure.yasnippet create mode 100644 snippets/delphi-mode/try ... finally.yasnippet create mode 100644 snippets/erlang-mode/inc.lib create mode 100644 snippets/text-mode/email create mode 100644 snippets/text-mode/time diff --git a/snippets/c++-mode/#i.yasnippet b/snippets/c++-mode/#i.yasnippet new file mode 100644 index 0000000..b150d38 --- /dev/null +++ b/snippets/c++-mode/#i.yasnippet @@ -0,0 +1,4 @@ +# -*- mode: snippet -*- +# name: #include <...> +# -- +#include <$0> \ No newline at end of file diff --git a/snippets/c++-mode/local-#i.yasnippet b/snippets/c++-mode/local-#i.yasnippet new file mode 100644 index 0000000..ceb4b37 --- /dev/null +++ b/snippets/c++-mode/local-#i.yasnippet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #include "..." +# key: #i +# -- +#include "$0" \ No newline at end of file diff --git a/snippets/c-mode/fopen b/snippets/c-mode/fopen new file mode 100644 index 0000000..044c743 --- /dev/null +++ b/snippets/c-mode/fopen @@ -0,0 +1,3 @@ +#name : FILE *fp = fopen(..., ...); +# -- +FILE *${fp} = fopen(${"file"}, "${r}"); diff --git a/snippets/delphi-mode/begin ... end.yasnippet b/snippets/delphi-mode/begin ... end.yasnippet new file mode 100644 index 0000000..5b02ee0 --- /dev/null +++ b/snippets/delphi-mode/begin ... end.yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: begin ... end +# key: begin +# -- +begin +$0 +end; \ No newline at end of file diff --git a/snippets/delphi-mode/class (class).yasnippet b/snippets/delphi-mode/class (class).yasnippet new file mode 100644 index 0000000..a0d8b46 --- /dev/null +++ b/snippets/delphi-mode/class (class).yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: class (class) +# key: class +# -- +T${1:ClassName} = class +$0 +end; \ No newline at end of file diff --git a/snippets/delphi-mode/constructor, destructor.yasnippet b/snippets/delphi-mode/constructor, destructor.yasnippet new file mode 100644 index 0000000..114f30e --- /dev/null +++ b/snippets/delphi-mode/constructor, destructor.yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: constructor, destructor +# key: constructor +# condition: (delphi-in-class-definition) +# -- +constructor Create(${1:}); +destructor Destroy; override; + $0$> \ No newline at end of file diff --git a/snippets/delphi-mode/dbg.yasnippet b/snippets/delphi-mode/dbg.yasnippet new file mode 100644 index 0000000..66fc15f --- /dev/null +++ b/snippets/delphi-mode/dbg.yasnippet @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Alexander Sulfrian +# name: dbg +# -- +DebugWriteln($1); + $0$> \ No newline at end of file diff --git a/snippets/delphi-mode/for ... end.yasnippet b/snippets/delphi-mode/for ... end.yasnippet new file mode 100644 index 0000000..5353d53 --- /dev/null +++ b/snippets/delphi-mode/for ... end.yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: for ... end +# key: for +# -- +for ${1:I} := ${2:0} to ${3:max} do +begin +$0 +end; \ No newline at end of file diff --git a/snippets/delphi-mode/func-prototype.yasnippet b/snippets/delphi-mode/func-prototype.yasnippet new file mode 100644 index 0000000..2344f07 --- /dev/null +++ b/snippets/delphi-mode/func-prototype.yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: function prototype +# key: func +# condition: (delphi-in-class-definition) +# -- +function ${1:Name$(upcase-initials text)}($2): $3; + $0$> \ No newline at end of file diff --git a/snippets/delphi-mode/func.yasnippet b/snippets/delphi-mode/func.yasnippet new file mode 100644 index 0000000..31fe413 --- /dev/null +++ b/snippets/delphi-mode/func.yasnippet @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: function +# key: func +# condition: (not (delphi-in-class-definition)) +# -- +function ${1:$$(yas/choose-value (let (value) (dolist (element (delphi-get-classes) value) (setq value (cons (concat element ".") value)))))}${2:Name$(upcase-initials text)}($3): $4; +begin +$0 +end; \ No newline at end of file diff --git a/snippets/delphi-mode/if ... end.yasnippet b/snippets/delphi-mode/if ... end.yasnippet new file mode 100644 index 0000000..030bb7f --- /dev/null +++ b/snippets/delphi-mode/if ... end.yasnippet @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: if ... end +# key: if +# -- +if $1 then +begin +$0 +end; \ No newline at end of file diff --git a/snippets/delphi-mode/procedure-prototype.yasnippet b/snippets/delphi-mode/procedure-prototype.yasnippet new file mode 100644 index 0000000..3c1d8cb --- /dev/null +++ b/snippets/delphi-mode/procedure-prototype.yasnippet @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: procedure prototype +# key: proc +# condition: (delphi-in-class-definition) +# -- +procedure ${1:Name$(upcase-initials text)}($2); + $0$> \ No newline at end of file diff --git a/snippets/delphi-mode/procedure.yasnippet b/snippets/delphi-mode/procedure.yasnippet new file mode 100644 index 0000000..6039ad8 --- /dev/null +++ b/snippets/delphi-mode/procedure.yasnippet @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: procedure +# key: proc +# condition: (not (delphi-in-class-definition)) +# -- +procedure ${1:$$(yas/choose-value (let (value) (dolist (element (delphi-get-classes) value) (setq value (cons (concat element ".") value)))))}${2:Name$(upcase-initials text)}($3); +begin +$0 +end; \ No newline at end of file diff --git a/snippets/delphi-mode/try ... finally.yasnippet b/snippets/delphi-mode/try ... finally.yasnippet new file mode 100644 index 0000000..9a33d5f --- /dev/null +++ b/snippets/delphi-mode/try ... finally.yasnippet @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: Alexander Sulfrian +# name: try ... finally +# key: try +# -- +try +$0 +finally +$1 +end; \ No newline at end of file diff --git a/snippets/erlang-mode/inc.lib b/snippets/erlang-mode/inc.lib new file mode 100644 index 0000000..09a6723 --- /dev/null +++ b/snippets/erlang-mode/inc.lib @@ -0,0 +1,4 @@ +#name : -include_lib("..."). +# -- +-include_lib("$1"). +$0 diff --git a/snippets/text-mode/email b/snippets/text-mode/email new file mode 100644 index 0000000..1ac7f94 --- /dev/null +++ b/snippets/text-mode/email @@ -0,0 +1,3 @@ +#name : (user's email) +# -- +`(replace-regexp-in-string "@" "@NOSPAM." user-mail-address)` \ No newline at end of file diff --git a/snippets/text-mode/time b/snippets/text-mode/time new file mode 100644 index 0000000..d744f1a --- /dev/null +++ b/snippets/text-mode/time @@ -0,0 +1,3 @@ +#name : (current time) +# -- +`(current-time-string)` \ No newline at end of file -- cgit v1.2.3