Emacs Erlang snippets
posted by hitesh on 2008-08-19
Continuing with my previous yasnippet for Ruby, here are some snippets for Erlang mode.
Installation
- Create an erlang-mode directory under text-mode
Save the following code in a file named mod.
#name : -module(). #contributor : hitesh <hitesh.jasani@gmail.com> # -- -module(${1:$(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))}). $0Save the following code in a file named exp.
#name : -export([]). #contributor : hitesh <hitesh.jasani@gmail.com> # -- -export([${1:start/0}]). $0Save the following code in a file named imp.
#name : -import([]). #contributor : hitesh <hitesh.jasani@gmail.com> # -- -import(${1:lists}, [${2:map/2, sum/1}]). $0Add a hook in your .emacs to enable yas mode with erlang.
(add-hook 'erlang-mode-hook 'yas/minor-mode-on)
Referrers
- http://groups.google.com/group/smart-snippet/browse_thread/thread/7d16b175bb223659
- http://www.google.com/reader/view/
- http://www.artima.com/forums/flat.jsp?forum=123&thread=236862
- http://www.reddit.com/r/erlang/
- http://www.reddit.com/
- http://www.reddit.com/r/erlang
- http://www.google.com/reader/view/?tab=my
- http://www.reddit.com/r/erlang/comments/6x3xn/emacs_erlang_snippets/
- http://www.reddit.com/search?q=emacs&x=0&y=0
- http://search.live.com/results.aspx?q=erlang
About
Hitesh wrote his first program on a punch card in 1979 ... he's been debugging it ever since.