Skip to content

Commit 077dc76

Browse files
committed
Elixir snippets
initial version
1 parent 4b15c73 commit 077dc76

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

neosnippets/elixir.snip

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
snippet do
2+
abbr do...end
3+
options head
4+
do
5+
${1:TARGET}
6+
end
7+
8+
snippet if
9+
abbr if .. do .. end
10+
options head
11+
if ${1:true} do
12+
${2:TARGET}
13+
end
14+
15+
snippet ife
16+
abbr if .. do .. else .. end
17+
options head
18+
if ${1:true} do
19+
${2:ok}
20+
else
21+
${3:ok}
22+
end
23+
24+
snippet case
25+
abbr case .. end
26+
options head
27+
case ${1} do
28+
${2} -> ${3}
29+
end
30+
31+
snippet def
32+
abbr def .. do .. end
33+
options head
34+
def ${1:name} do
35+
${2}
36+
end
37+
38+
snippet defm
39+
abbr def module
40+
options head
41+
defmodule ${1:module_name} do
42+
${2}
43+
end
44+
45+
snippet defp
46+
abbr defp .. end
47+
options head
48+
defp ${1:name} do
49+
${2}
50+
end
51+
52+
snippet doc
53+
abbr @doc """..."""
54+
options head
55+
@doc """${0:TARGET}"""
56+
57+
snippet mdoc
58+
abbr @moduledoc """..."""
59+
options head
60+
@moduledoc """${0:TARGET}"""
61+
62+
snippet fn
63+
abbr fn(..) -> .. end
64+
options head
65+
fn(${1:args}) -> ${2:TARGET} end
66+
67+
snippet rec
68+
abbr receive .. do .. end
69+
options head
70+
receive do
71+
${1} -> ${2}
72+
end
73+
74+
snippet test
75+
abbr test .. do .. end
76+
options head
77+
test "${1:test_name}" do
78+
${2}
79+
end
80+
81+
snippet try
82+
abbr try .. rescue .. end
83+
options head
84+
try do
85+
${1}
86+
rescue
87+
${2} -> ${3}

0 commit comments

Comments
 (0)