summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Crotti <andrea.crotti.0@gmail.com>2016-08-08 12:10:48 +0100
committerGitHub <noreply@github.com>2016-08-08 12:10:48 +0100
commit39677e8e940a3dd285bde47b060e76a9fb0c2051 (patch)
tree0f54591bac36b85b8199336b61d6c46a7dc3cdc9
parent9fb8141e50a640e404ce365d531b3eb3bd872571 (diff)
parentb391ba50d58f0522e3f728cc8cd6dc158e8810f2 (diff)
Merge pull request #157 from kwrooijen/add-elixir-snippets
Added useful Elixir snippets
-rw-r--r--elixir-mode/call5
-rw-r--r--elixir-mode/cast5
-rw-r--r--elixir-mode/do7
-rw-r--r--elixir-mode/hcall8
-rw-r--r--elixir-mode/hcast8
-rw-r--r--elixir-mode/hinfo8
-rw-r--r--elixir-mode/io5
-rw-r--r--elixir-mode/iop5
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