summaryrefslogtreecommitdiffstats
path: root/snippets/delphi-mode
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--snippets/delphi-mode/begin ... end.yasnippet8
-rw-r--r--snippets/delphi-mode/class (class).yasnippet8
-rw-r--r--snippets/delphi-mode/constructor, destructor.yasnippet9
-rw-r--r--snippets/delphi-mode/dbg.yasnippet6
-rw-r--r--snippets/delphi-mode/for ... end.yasnippet9
-rw-r--r--snippets/delphi-mode/func-prototype.yasnippet8
-rw-r--r--snippets/delphi-mode/func.yasnippet10
-rw-r--r--snippets/delphi-mode/if ... end.yasnippet9
-rw-r--r--snippets/delphi-mode/procedure-prototype.yasnippet8
-rw-r--r--snippets/delphi-mode/procedure.yasnippet10
-rw-r--r--snippets/delphi-mode/try ... finally.yasnippet10
11 files changed, 95 insertions, 0 deletions
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