]> git.r.bdr.sh - rbdr/dotfiles/blob - vim/snippets/erlang.snippets
Add install script
[rbdr/dotfiles] / vim / snippets / erlang.snippets
1 # module and export all
2 snippet mod
3 -module(${1:`Filename('', 'my')`}).
4
5 -compile([export_all]).
6
7 start() ->
8 ${2}
9
10 stop() ->
11 ok.
12 # define directive
13 snippet def
14 -define(${1:macro}, ${2:body}).${3}
15 # export directive
16 snippet exp
17 -export([${1:function}/${2:arity}]).
18 # include directive
19 snippet inc
20 -include("${1:file}").${2}
21 # behavior directive
22 snippet beh
23 -behaviour(${1:behaviour}).${2}
24 # if expression
25 snippet if
26 if
27 ${1:guard} ->
28 ${2:body}
29 end
30 # case expression
31 snippet case
32 case ${1:expression} of
33 ${2:pattern} ->
34 ${3:body};
35 end
36 # record directive
37 snippet rec
38 -record(${1:record}, {
39 ${2:field}=${3:value}}).${4}