summaryrefslogtreecommitdiff
path: root/.vim/snippets/erlang.snippets
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-03-13 10:40:19 +0100
committerTobias Klauser <tklauser@distanz.ch>2014-03-13 10:40:19 +0100
commit77a122f0581d02845d8c7f0c1b889984a2627a35 (patch)
treecc77d8478ebea02b5c46b819639c5e1cae26565f /.vim/snippets/erlang.snippets
parent5712528bbf80bb8f7b79ea5cdb94314659addba7 (diff)
Add snipMate
Diffstat (limited to '.vim/snippets/erlang.snippets')
-rw-r--r--.vim/snippets/erlang.snippets39
1 files changed, 39 insertions, 0 deletions
diff --git a/.vim/snippets/erlang.snippets b/.vim/snippets/erlang.snippets
new file mode 100644
index 0000000..7238149
--- /dev/null
+++ b/.vim/snippets/erlang.snippets
@@ -0,0 +1,39 @@
+# module and export all
+snippet mod
+ -module(${1:`Filename('', 'my')`}).
+
+ -compile([export_all]).
+
+ start() ->
+ ${2}
+
+ stop() ->
+ ok.
+# define directive
+snippet def
+ -define(${1:macro}, ${2:body}).${3}
+# export directive
+snippet exp
+ -export([${1:function}/${2:arity}]).
+# include directive
+snippet inc
+ -include("${1:file}").${2}
+# behavior directive
+snippet beh
+ -behaviour(${1:behaviour}).${2}
+# if expression
+snippet if
+ if
+ ${1:guard} ->
+ ${2:body}
+ end
+# case expression
+snippet case
+ case ${1:expression} of
+ ${2:pattern} ->
+ ${3:body};
+ end
+# record directive
+snippet rec
+ -record(${1:record}, {
+ ${2:field}=${3:value}}).${4}