Elixir cleanup + 5 useful snippets (#245)
* removed trailing newline from elixir snippets * 5 convenience snippets I often use
This commit is contained in:
parent
7fc2b95e2f
commit
2bb3cc1b2e
6
snippets/elixir-mode/after
Normal file
6
snippets/elixir-mode/after
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
## -*- mode: snippet -*-
|
||||||
|
# name : after
|
||||||
|
# key: after
|
||||||
|
# --
|
||||||
|
after ${1:500} ->
|
||||||
|
$0
|
7
snippets/elixir-mode/defmodule_filename
Normal file
7
snippets/elixir-mode/defmodule_filename
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
## -*- mode: snippet -*-
|
||||||
|
# name : defmodule XXX end
|
||||||
|
# key: dm
|
||||||
|
# --
|
||||||
|
defmodule ${1:`(concat (capitalize (file-name-nondirectory (directory-file-name (file-name-directory buffer-file-name)))) ".")`}${2:`(mapconcat 'capitalize (split-string (file-name-base) "_") "")`} do
|
||||||
|
$0
|
||||||
|
end
|
7
snippets/elixir-mode/function
Normal file
7
snippets/elixir-mode/function
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
## -*- mode: snippet -*-
|
||||||
|
# name : function
|
||||||
|
# key: dfun
|
||||||
|
# --
|
||||||
|
def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))} do
|
||||||
|
$0
|
||||||
|
end
|
5
snippets/elixir-mode/function-one-line
Normal file
5
snippets/elixir-mode/function-one-line
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
## -*- mode: snippet -*-
|
||||||
|
# name : function-one-line
|
||||||
|
# key: df
|
||||||
|
# --
|
||||||
|
def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))}, do: $0
|
7
snippets/elixir-mode/receive
Normal file
7
snippets/elixir-mode/receive
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
## -*- mode: snippet -*-
|
||||||
|
# name : receive
|
||||||
|
# key: rcv
|
||||||
|
# --
|
||||||
|
receive do
|
||||||
|
$0
|
||||||
|
end
|
Loading…
Reference in a new issue