mirror of
https://github.com/gryf/snipmate.vim.git
synced 2025-12-19 20:38:05 +01:00
Added some basic erlang snippets.
Signed-off-by: Michael Sanders <msanders42@gmail.com>
This commit is contained in:
committed by
Michael Sanders
parent
f28bf1de39
commit
6ffe172dc6
39
snippets/erlang.snippets
Normal file
39
snippets/erlang.snippets
Normal file
@@ -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}
|
||||
Reference in New Issue
Block a user