diff --git a/snippets/kotlin-mode/anonymous b/snippets/kotlin-mode/anonymous new file mode 100644 index 0000000..cb5c1f1 --- /dev/null +++ b/snippets/kotlin-mode/anonymous @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Anonymous class +# key: object +# -- +object: $1 { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/closure b/snippets/kotlin-mode/closure new file mode 100644 index 0000000..e852372 --- /dev/null +++ b/snippets/kotlin-mode/closure @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Closure (function without name) +# key: closure +# -- +{ $1 -> $0 } \ No newline at end of file diff --git a/snippets/kotlin-mode/exfun b/snippets/kotlin-mode/exfun new file mode 100644 index 0000000..80a59c6 --- /dev/null +++ b/snippets/kotlin-mode/exfun @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Extension function +# key: exfun +# -- +fun $1.$2($3): $4 { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/exval b/snippets/kotlin-mode/exval new file mode 100644 index 0000000..1048e12 --- /dev/null +++ b/snippets/kotlin-mode/exval @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Extension read-only property +# key: exval +# -- +val $1.$2: $3 + get() { + $0 + } \ No newline at end of file diff --git a/snippets/kotlin-mode/exvar b/snippets/kotlin-mode/exvar new file mode 100644 index 0000000..11734e2 --- /dev/null +++ b/snippets/kotlin-mode/exvar @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: Extension read-write property +# key: exvar +# -- +var $1.$2: $3 + get() { + $0 + } + set(value) { + + } \ No newline at end of file diff --git a/snippets/kotlin-mode/fun b/snippets/kotlin-mode/fun new file mode 100644 index 0000000..36d8c25 --- /dev/null +++ b/snippets/kotlin-mode/fun @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Function with no parameters +# key: fun0 +# -- +fun $1($2): $3 { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/ifn b/snippets/kotlin-mode/ifn new file mode 100644 index 0000000..a34ab27 --- /dev/null +++ b/snippets/kotlin-mode/ifn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Inserts 'if null' expression +# key: ifn +# -- +if ($1 == null) { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/inn b/snippets/kotlin-mode/inn new file mode 100644 index 0000000..33a3677 --- /dev/null +++ b/snippets/kotlin-mode/inn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Inserts 'if not null' expression +# key: inn +# -- +if ($1 != null) { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/interface b/snippets/kotlin-mode/interface new file mode 100644 index 0000000..f6e7446 --- /dev/null +++ b/snippets/kotlin-mode/interface @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Interface +# key: interface +# -- +interface $1 { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/iter b/snippets/kotlin-mode/iter new file mode 100644 index 0000000..e1922d2 --- /dev/null +++ b/snippets/kotlin-mode/iter @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Iterate over elements of iterable (for-in) loop +# key: iter +# -- +for ($1 in $2) { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/main b/snippets/kotlin-mode/main new file mode 100644 index 0000000..d5528b2 --- /dev/null +++ b/snippets/kotlin-mode/main @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: main() function +# key: main +# -- +fun main(args: Array) { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/psvm b/snippets/kotlin-mode/psvm new file mode 100644 index 0000000..dfc9d5a --- /dev/null +++ b/snippets/kotlin-mode/psvm @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: psvm +# key: psvm +# -- +fun main(args: Array) { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/serr b/snippets/kotlin-mode/serr new file mode 100644 index 0000000..43bdad0 --- /dev/null +++ b/snippets/kotlin-mode/serr @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Prints a string to System.err +# key: serr +# -- +System.err.println($0) diff --git a/snippets/kotlin-mode/singleton b/snippets/kotlin-mode/singleton new file mode 100644 index 0000000..cb73dec --- /dev/null +++ b/snippets/kotlin-mode/singleton @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Singleton +# key: singleton +# -- +object $1 { + $0 +} \ No newline at end of file diff --git a/snippets/kotlin-mode/sout b/snippets/kotlin-mode/sout new file mode 100644 index 0000000..2e140ca --- /dev/null +++ b/snippets/kotlin-mode/sout @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Prints a string to System.out +# key: sout +# -- +println($0) \ No newline at end of file diff --git a/snippets/kotlin-mode/soutv b/snippets/kotlin-mode/soutv new file mode 100644 index 0000000..d455eed --- /dev/null +++ b/snippets/kotlin-mode/soutv @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Prints a value to System.out +# key: soutv +# -- +println("$0 = ${$0}") \ No newline at end of file diff --git a/snippets/kotlin-mode/void b/snippets/kotlin-mode/void new file mode 100644 index 0000000..257bb59 --- /dev/null +++ b/snippets/kotlin-mode/void @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Function returning nothing +# key: void +# -- +fun $1($2) { + $0 +} \ No newline at end of file