aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-snippets/UltiSnips/erlang.snippets
blob: f317685c0533c63cd178f4114ea61b259a218db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
###########################################################################
#                            TEXTMATE SNIPPETS                            #
###########################################################################

priority -50

snippet pat "Case:Receive:Try Clause"
${1:pattern}${2: when ${3:guard}} ->
	${4:body}
endsnippet

snippet beh "Behaviour Directive" b
-behaviour(${1:behaviour}).
endsnippet

snippet case "Case Expression"
case ${1:expression} of
	${2:pattern}${3: when ${4:guard}} ->
		${5:body}
end
endsnippet

snippet def "Define Directive" b
-define(${1:macro}${2: (${3:param})}, ${4:body}).
endsnippet

snippet exp "Export Directive" b
-export([${1:function}/${2:arity}]).
endsnippet

snippet fun "Fun Expression"
fun
	(${1:pattern})${2: when ${3:guard}} ->
		${4:body}
end
endsnippet

snippet fu "Function"
${1:function}(${2:param})${3: when ${4:guard}} ->
	${5:body}
endsnippet

snippet if "If Expression"
if
	${1:guard} ->
		${2:body}
end
endsnippet

snippet ifdef "Ifdef Directive" b
-ifdef(${1:macro}).
endsnippet

snippet ifndef "Ifndef Directive" b
-ifndef(${1:macro}).
endsnippet

snippet imp "Import Directive" b
-import(${1:module}, [${2:function}/${3:arity}]).
endsnippet

snippet inc "Include Directive" b
-include("${1:file}").
endsnippet

snippet mod "Module Directive" b
-module(${1:`!p snip.rv = snip.basename or "module"`}).
endsnippet

snippet rcv "Receive Expression"
receive
${1:	${2:pattern}${3: when ${4:guard}} ->
		${5:body}}
${6:after
	${7:expression} ->
		${8:body}}
end
endsnippet

snippet rec "Record Directive" b
-record(${1:record}, {${2:field}${3: = ${4:value}}}).
endsnippet

snippet try "Try Expression"
try${1: ${2:expression}${3: of
	${4:pattern}${5: when ${6:guard}} ->
		${7:body}}}
${8:catch
	${9:pattern}${10: when ${11:guard}} ->
		${12:body}}
${13:after
	${14:body}}
end
endsnippet

snippet undef "Undef Directive" b
-undef(${1:macro}).
endsnippet

snippet || "List Comprehension"
[${1:X} || ${2:X} <- ${3:List}${4:, gen}]
endsnippet

snippet gen "Generator Expression"
${1:X} <- ${2:List}${3:, gen}
endsnippet

# vim:ft=snippets: