diff --git a/snippets/julia-mode/.yas-setup.el b/snippets/julia-mode/.yas-setup.el new file mode 100644 index 000000000..630d1dbd7 --- /dev/null +++ b/snippets/julia-mode/.yas-setup.el @@ -0,0 +1,5 @@ +(require 'yasnippet) + +(defun yas-julia-iteration-keyword-choice () + "Choose the iteration keyword for for-loop" + (yas-choose-value '("=" "in" "∈"))) diff --git a/snippets/julia-mode/atype b/snippets/julia-mode/atype new file mode 100644 index 000000000..9721a046a --- /dev/null +++ b/snippets/julia-mode/atype @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: abstract type ... end +# key: atype +# contributor: hankail05 +# -- +abstract type ${1:${2:type} <: ${3:supertype}} end$0 \ No newline at end of file diff --git a/snippets/julia-mode/begin b/snippets/julia-mode/begin new file mode 100644 index 000000000..78f851e60 --- /dev/null +++ b/snippets/julia-mode/begin @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: begin ... end +# key: begin +# contributor: hankail05 +# -- +begin + ${1:body} +end +$0 diff --git a/snippets/julia-mode/do b/snippets/julia-mode/do new file mode 100644 index 000000000..7630ffcfa --- /dev/null +++ b/snippets/julia-mode/do @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: do ... ... end +# key: do +# contributor: hankail05 +# -- +do ${1:x} + ${2:body} +end +$0 \ No newline at end of file diff --git a/snippets/julia-mode/for b/snippets/julia-mode/for new file mode 100644 index 000000000..8f9619f43 --- /dev/null +++ b/snippets/julia-mode/for @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: for ... ... end +# key: for +# contributor: hankail05 +# -- +for ${1:i} ${2:$$(yas-julia-iteration-keyword-choice)} ${3:1:n} + ${4:body} +end +$0 diff --git a/snippets/julia-mode/fun b/snippets/julia-mode/fun new file mode 100644 index 000000000..2abeccf1b --- /dev/null +++ b/snippets/julia-mode/fun @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: function(...) ... end +# key: fun +# contributor: hankail05 +# -- +function ${1:fun}(${2:args}) + ${3:body} +end +$0 \ No newline at end of file diff --git a/snippets/julia-mode/if b/snippets/julia-mode/if new file mode 100644 index 000000000..adc4ad048 --- /dev/null +++ b/snippets/julia-mode/if @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if ... ... end +# key: if +# contributor: hankail05 +# -- +if ${1:cond} + ${2:body} +end +$0 diff --git a/snippets/julia-mode/ife b/snippets/julia-mode/ife new file mode 100644 index 000000000..f2578d404 --- /dev/null +++ b/snippets/julia-mode/ife @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: if ... ... else ... end +# key: ife +# contributor: hankail05 +# -- +if ${1:cond} + ${2:true} +else + ${3:false} +end +$0 \ No newline at end of file diff --git a/snippets/julia-mode/let b/snippets/julia-mode/let new file mode 100644 index 000000000..e53385cb6 --- /dev/null +++ b/snippets/julia-mode/let @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: let ... ... end +# key: let +# contributor: hankail05 +# -- +let ${1:x = 0} + ${2:body} +end +$0 \ No newline at end of file diff --git a/snippets/julia-mode/macro b/snippets/julia-mode/macro new file mode 100644 index 000000000..56b29765d --- /dev/null +++ b/snippets/julia-mode/macro @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: macro(...) ... end +# key: macro +# contributor: hankail05 +# -- +macro ${1:macro}(${2:args}) + ${3:body} +end +$0 diff --git a/snippets/julia-mode/module b/snippets/julia-mode/module new file mode 100644 index 000000000..4ff4538e9 --- /dev/null +++ b/snippets/julia-mode/module @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: module ... ... end +# key: module +# contributor: hankail05 +# -- +module ${1:name} +${2:body} +end +$0 diff --git a/snippets/julia-mode/mutstr b/snippets/julia-mode/mutstr new file mode 100644 index 000000000..feeb3c783 --- /dev/null +++ b/snippets/julia-mode/mutstr @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: mutable struct ... end +# key: mutstr +# contributor: hankail05 +# -- +mutable struct ${1:name} + ${2:body} +end +$0 diff --git a/snippets/julia-mode/ptype b/snippets/julia-mode/ptype new file mode 100644 index 000000000..d40dd0995 --- /dev/null +++ b/snippets/julia-mode/ptype @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: primitive type ... end +# key: ptype +# contributor: hankail05 +# -- +primitive type ${1:${2:type} <: ${3:supertype}} ${4:bits} end$0 diff --git a/snippets/julia-mode/quote b/snippets/julia-mode/quote new file mode 100644 index 000000000..cc3a2e0bc --- /dev/null +++ b/snippets/julia-mode/quote @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: quote ... end +# key: quote +# contributor: hankail05 +# -- +quote + ${1:expr} +end +$0 \ No newline at end of file diff --git a/snippets/julia-mode/struct b/snippets/julia-mode/struct new file mode 100644 index 000000000..b0d31e0f4 --- /dev/null +++ b/snippets/julia-mode/struct @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: struct ... end +# key: struct +# contributor: hankail05 +# -- +struct ${1:name} + ${2:body} +end +$0 \ No newline at end of file diff --git a/snippets/julia-mode/try b/snippets/julia-mode/try new file mode 100644 index 000000000..932c86c6c --- /dev/null +++ b/snippets/julia-mode/try @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: try ... catch ... end +# key: try +# contributor: hankail05 +# -- +try + ${1:expr} +catch ${2:error} + ${3:e_expr} +end +$0 diff --git a/snippets/julia-mode/tryf b/snippets/julia-mode/tryf new file mode 100644 index 000000000..0ebb5e132 --- /dev/null +++ b/snippets/julia-mode/tryf @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: try ... catch ... finally ... end +# key: try +# contributor: hankail05 +# -- +try + ${1:expr} +catch ${2:error} + ${3:e_expr} +finally + ${4:f_expr} +end +$0 diff --git a/snippets/julia-mode/using b/snippets/julia-mode/using new file mode 100644 index 000000000..cdc8ad4bf --- /dev/null +++ b/snippets/julia-mode/using @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: using ... +# key: using +# contributor: hankail05 +# -- +using ${1:${2:package}:}$0 diff --git a/snippets/julia-mode/while b/snippets/julia-mode/while new file mode 100644 index 000000000..7a13bca1a --- /dev/null +++ b/snippets/julia-mode/while @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: while ... ... end +# key: while +# contributor: hankail05 +# -- +while ${1:cond} + ${2:body} +end +$0 \ No newline at end of file