diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-02-03 21:53:13 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-02-03 21:53:13 +0100 |
commit | dd3dff6eebcd8fb14d8ba9b0666365bea62e5d81 (patch) | |
tree | 15344c68c599cef88689ea5e36c584a4fe2534d9 /snippets | |
parent | 3f5edbfe13f4bca10274e0999376502fa9ed346d (diff) | |
download | emacs-dd3dff6eebcd8fb14d8ba9b0666365bea62e5d81.tar.gz emacs-dd3dff6eebcd8fb14d8ba9b0666365bea62e5d81.tar.xz emacs-dd3dff6eebcd8fb14d8ba9b0666365bea62e5d81.zip |
Add own snippets
Diffstat (limited to 'snippets')
-rw-r--r-- | snippets/c++-mode/#i.yasnippet | 4 | ||||
-rw-r--r-- | snippets/c++-mode/local-#i.yasnippet | 5 | ||||
-rw-r--r-- | snippets/c-mode/fopen | 3 | ||||
-rw-r--r-- | snippets/delphi-mode/begin ... end.yasnippet | 8 | ||||
-rw-r--r-- | snippets/delphi-mode/class (class).yasnippet | 8 | ||||
-rw-r--r-- | snippets/delphi-mode/constructor, destructor.yasnippet | 9 | ||||
-rw-r--r-- | snippets/delphi-mode/dbg.yasnippet | 6 | ||||
-rw-r--r-- | snippets/delphi-mode/for ... end.yasnippet | 9 | ||||
-rw-r--r-- | snippets/delphi-mode/func-prototype.yasnippet | 8 | ||||
-rw-r--r-- | snippets/delphi-mode/func.yasnippet | 10 | ||||
-rw-r--r-- | snippets/delphi-mode/if ... end.yasnippet | 9 | ||||
-rw-r--r-- | snippets/delphi-mode/procedure-prototype.yasnippet | 8 | ||||
-rw-r--r-- | snippets/delphi-mode/procedure.yasnippet | 10 | ||||
-rw-r--r-- | snippets/delphi-mode/try ... finally.yasnippet | 10 | ||||
-rw-r--r-- | snippets/erlang-mode/inc.lib | 4 | ||||
-rw-r--r-- | snippets/text-mode/email | 3 | ||||
-rw-r--r-- | snippets/text-mode/time | 3 |
17 files changed, 117 insertions, 0 deletions
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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 <alexander@sulfrian.net> +# 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 |