added snippets for erlang

This commit is contained in:
syl20bnr 2013-01-23 19:53:54 -05:00
parent 2fde3a45c7
commit bdad8b9339
23 changed files with 128 additions and 0 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "extensions/pylookup"]
path = extensions/pylookup
url = http://github.com/syl20bnr/pylookup
[submodule "extensions/projmake-mode"]
path = extensions/projmake-mode
url = http://github.com/ericbmerritt/projmake-mode

View File

@ -0,0 +1 @@
text-mode

View File

@ -0,0 +1,5 @@
# name: after ... ->
# key: after
# --
after
$1 -> $0

View File

@ -0,0 +1,6 @@
# name: begin ... end
# key: begin
# --
begin
$0
end

5
snippets/erlang-mode/beh Normal file
View File

@ -0,0 +1,5 @@
# name: -behaviour(...).
# key: beh
# --
-behaviour(${1:gen_server}).
$0

View File

@ -0,0 +1,6 @@
# name: case ... of ... end
# key: case
# --
case $1 of
$0
end

View File

@ -0,0 +1,5 @@
# name: -compile(...).
# key: compile
# --
-compile([${1:export_all}]).
$0

5
snippets/erlang-mode/def Normal file
View File

@ -0,0 +1,5 @@
# name: -define(...,...).
# key: def
# --
-define($1,$2).
$0

6
snippets/erlang-mode/exp Normal file
View File

@ -0,0 +1,6 @@
# name: -export([]).
# contributor: hitesh <hitesh.jasani@gmail.com>
# key: exp
# --
-export([${1:start/0}]).
$0

4
snippets/erlang-mode/fun Normal file
View File

@ -0,0 +1,4 @@
# name: fun (...) -> ... end
# key: fun
# --
fun ($1) -> $0 end

7
snippets/erlang-mode/if Normal file
View File

@ -0,0 +1,7 @@
# name: if ... -> ... ; true -> ... end
# key: if
# --
if
$1 -> $2;
true -> $0
end

View File

@ -0,0 +1,6 @@
# name: -ifdef(...). ... -endif.
# key: ifdef
# --
-ifdef($1).
$0
-endif.

View File

@ -0,0 +1,6 @@
# name: -ifndef(...). ... -endif.
# key: ifndef
# --
-ifndef($1).
$0
-endif.

6
snippets/erlang-mode/imp Normal file
View File

@ -0,0 +1,6 @@
# name: -import([]).
# contributor: hitesh <hitesh.jasani@gmail.com>
# key: imp
# --
-import(${1:lists}, [${2:map/2, sum/1}]).
$0

5
snippets/erlang-mode/inc Normal file
View File

@ -0,0 +1,5 @@
# name: -include("...").
# key: inc
# --
-include("$1").
$0

View File

@ -0,0 +1,5 @@
# name: -include_lib("...").
# key: inc
# --
-include_lib("$1").
$0

View File

@ -0,0 +1,9 @@
# name: loop(...) -> receive _ -> loop(...) end.
# key: loop
# --
${1:loop}($2) ->
receive
${3:_} ->
$1($2)
end.
$0

7
snippets/erlang-mode/mod Normal file
View File

@ -0,0 +1,7 @@
# name: -module().
# contributor: hitesh <hitesh.jasani@gmail.com>
# key: mod
# --
-module(${1:`(file-name-nondirectory
(file-name-sans-extension (or (buffer-file-name) (buffer-name))))`}).
$0

6
snippets/erlang-mode/rcv Normal file
View File

@ -0,0 +1,6 @@
# name: receive ... -> ... end
# key: rcv
# --
receive
$1 -> $0
end

View File

@ -0,0 +1,7 @@
# name: receive after ... -> ... end
# key: rcv
# --
receive
after
$1 -> $0
end

5
snippets/erlang-mode/rec Normal file
View File

@ -0,0 +1,5 @@
# name: -record(...,{...}).
# key: rec
# --
-record($1,{$2}).
$0

8
snippets/erlang-mode/try Normal file
View File

@ -0,0 +1,8 @@
# name: try ... of ... catch after end
# key: try
# --
try $1 of
$0
catch
after
end

View File

@ -0,0 +1,5 @@
# name: -undef(...).
# key: undef
# --
-undef($1).
$0