diff options
author | Kevin van Rooijen <kevin.van.rooijen@gmail.com> | 2016-08-04 15:12:32 +0300 |
---|---|---|
committer | Kevin van Rooijen <kevin.van.rooijen@gmail.com> | 2016-08-04 15:20:38 +0300 |
commit | b391ba50d58f0522e3f728cc8cd6dc158e8810f2 (patch) | |
tree | 0f54591bac36b85b8199336b61d6c46a7dc3cdc9 | |
parent | 9fb8141e50a640e404ce365d531b3eb3bd872571 (diff) |
Added useful Elixir snippets
-rw-r--r-- | elixir-mode/call | 5 | ||||
-rw-r--r-- | elixir-mode/cast | 5 | ||||
-rw-r--r-- | elixir-mode/do | 7 | ||||
-rw-r--r-- | elixir-mode/hcall | 8 | ||||
-rw-r--r-- | elixir-mode/hcast | 8 | ||||
-rw-r--r-- | elixir-mode/hinfo | 8 | ||||
-rw-r--r-- | elixir-mode/io | 5 | ||||
-rw-r--r-- | elixir-mode/iop | 5 |
8 files changed, 51 insertions, 0 deletions
diff --git a/elixir-mode/call b/elixir-mode/call new file mode 100644 index 0000000..27779ab --- /dev/null +++ b/elixir-mode/call @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: call +# key: call +# -- +GenServer.call(${1:__MODULE__}, $0) diff --git a/elixir-mode/cast b/elixir-mode/cast new file mode 100644 index 0000000..d06f3b7 --- /dev/null +++ b/elixir-mode/cast @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cast +# key: cast +# -- +GenServer.cast(${1:__MODULE__}, $0) diff --git a/elixir-mode/do b/elixir-mode/do new file mode 100644 index 0000000..807dc99 --- /dev/null +++ b/elixir-mode/do @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: do +# key: do +# -- +do + $0 +end diff --git a/elixir-mode/hcall b/elixir-mode/hcall new file mode 100644 index 0000000..d878b74 --- /dev/null +++ b/elixir-mode/hcall @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: hcall +# key: hcall +# -- +def handle_call($1, _from, state) do + reply = $0 + {:reply, reply, state} +end diff --git a/elixir-mode/hcast b/elixir-mode/hcast new file mode 100644 index 0000000..a217806 --- /dev/null +++ b/elixir-mode/hcast @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: hcast +# key: hcast +# -- +def handle_cast($1, state) do + $0 + {:noreply, state} +end diff --git a/elixir-mode/hinfo b/elixir-mode/hinfo new file mode 100644 index 0000000..f4539ac --- /dev/null +++ b/elixir-mode/hinfo @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: hinfo +# key: hinfo +# -- +def handle_info($1, state) do + $0 + {:noreply, state} +end diff --git a/elixir-mode/io b/elixir-mode/io new file mode 100644 index 0000000..dd916b4 --- /dev/null +++ b/elixir-mode/io @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: io +# key: io +# -- +IO.puts("$1")$0 diff --git a/elixir-mode/iop b/elixir-mode/iop new file mode 100644 index 0000000..a9ce985 --- /dev/null +++ b/elixir-mode/iop @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: iop +# key: iop +# -- +IO.puts("$1 #{inspect $1}")$0 |