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/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 ++++++++++ 11 files changed, 95 insertions(+) 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 (limited to 'snippets/delphi-mode') 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 -- cgit v1.2.3