2011-06-20 13:40:28 -04:00
|
|
|
# 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}
|
2012-02-06 08:36:44 -05:00
|
|
|
# todo comment
|
|
|
|
snippet todo
|
|
|
|
%% TODO: ${1}
|
|
|
|
## Snippets below (starting with '%') are in EDoc format.
|
|
|
|
## See http://www.erlang.org/doc/apps/edoc/chapter.html#id56887 for more details
|
|
|
|
# doc comment
|
|
|
|
snippet %d
|
|
|
|
%% @doc ${1}
|
|
|
|
# end of doc comment
|
|
|
|
snippet %e
|
|
|
|
%% @end
|
|
|
|
# specification comment
|
|
|
|
snippet %s
|
|
|
|
%% @spec ${1}
|
|
|
|
# private function marker
|
|
|
|
snippet %p
|
|
|
|
%% @private
|