init
This commit is contained in:
1
snippets/elixir-mode/.yas-parents
Normal file
1
snippets/elixir-mode/.yas-parents
Normal file
@@ -0,0 +1 @@
|
||||
prog-mode
|
||||
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
|
||||
5
snippets/elixir-mode/call
Normal file
5
snippets/elixir-mode/call
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: call
|
||||
# key: call
|
||||
# --
|
||||
GenServer.call(${1:__MODULE__}, $0)
|
||||
7
snippets/elixir-mode/case
Normal file
7
snippets/elixir-mode/case
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: case
|
||||
# key: case
|
||||
# --
|
||||
case $1 do
|
||||
$0
|
||||
end
|
||||
5
snippets/elixir-mode/cast
Normal file
5
snippets/elixir-mode/cast
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: cast
|
||||
# key: cast
|
||||
# --
|
||||
GenServer.cast(${1:__MODULE__}, $0)
|
||||
7
snippets/elixir-mode/cond
Normal file
7
snippets/elixir-mode/cond
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: cond
|
||||
# key: cond
|
||||
# --
|
||||
cond do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/def
Normal file
7
snippets/elixir-mode/def
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: def
|
||||
# key: def
|
||||
# --
|
||||
def ${1:function}${2:(${3:args})} do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/defmacro
Normal file
7
snippets/elixir-mode/defmacro
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defmacro
|
||||
# key: defmacro
|
||||
# --
|
||||
defmacro $1 do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/defmacrop
Normal file
7
snippets/elixir-mode/defmacrop
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defmacrop
|
||||
# key: defmacrop
|
||||
# --
|
||||
defmacrop $1 do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/defmodule
Normal file
7
snippets/elixir-mode/defmodule
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defmodule
|
||||
# key: defmodule
|
||||
# --
|
||||
defmodule $1 do
|
||||
$0
|
||||
end
|
||||
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/defp
Normal file
7
snippets/elixir-mode/defp
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: defp
|
||||
# key: defp
|
||||
# --
|
||||
defp $1 do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/do
Normal file
7
snippets/elixir-mode/do
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: do
|
||||
# key: do
|
||||
# --
|
||||
do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/doc
Normal file
7
snippets/elixir-mode/doc
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: doc
|
||||
# key: doc
|
||||
# --
|
||||
@doc """
|
||||
$0
|
||||
"""
|
||||
5
snippets/elixir-mode/fn
Normal file
5
snippets/elixir-mode/fn
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fn
|
||||
# key: fn
|
||||
# --
|
||||
fn ${1:x} -> $1$0 end
|
||||
7
snippets/elixir-mode/for
Normal file
7
snippets/elixir-mode/for
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for
|
||||
# key: for
|
||||
# --
|
||||
for ${2:x} <- ${1:enum} do
|
||||
$2$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/hcall
Normal file
7
snippets/elixir-mode/hcall
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: hcall
|
||||
# key: hcall
|
||||
# --
|
||||
def handle_call($1, _from, ${2:state}) do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/hcast
Normal file
7
snippets/elixir-mode/hcast
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: hcast
|
||||
# key: hcast
|
||||
# --
|
||||
def handle_cast($1, ${2:state}) do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/hinfo
Normal file
7
snippets/elixir-mode/hinfo
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: hinfo
|
||||
# key: hinfo
|
||||
# --
|
||||
def handle_info($1, ${2:state}) do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/if
Normal file
7
snippets/elixir-mode/if
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if
|
||||
# key: if
|
||||
# --
|
||||
if ${1:condition} do
|
||||
$0
|
||||
end
|
||||
9
snippets/elixir-mode/ife
Normal file
9
snippets/elixir-mode/ife
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: if-else
|
||||
# key: ife
|
||||
# --
|
||||
if ${1:condition} do
|
||||
$2
|
||||
else
|
||||
$3
|
||||
end
|
||||
5
snippets/elixir-mode/inspect
Normal file
5
snippets/elixir-mode/inspect
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: Inspect value
|
||||
# key: i
|
||||
# --
|
||||
IO.inspect($1, label: "$1")$0
|
||||
5
snippets/elixir-mode/io
Normal file
5
snippets/elixir-mode/io
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: io
|
||||
# key: io
|
||||
# --
|
||||
IO.puts("$1")$0
|
||||
5
snippets/elixir-mode/iop
Normal file
5
snippets/elixir-mode/iop
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: iop
|
||||
# key: iop
|
||||
# --
|
||||
IO.puts("$1 #{inspect $1}")$0
|
||||
7
snippets/elixir-mode/mdoc
Normal file
7
snippets/elixir-mode/mdoc
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: moduledoc
|
||||
# key: mdoc
|
||||
# --
|
||||
@moduledoc """
|
||||
$0
|
||||
"""
|
||||
6
snippets/elixir-mode/pry
Normal file
6
snippets/elixir-mode/pry
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: pry
|
||||
# key: pry
|
||||
# group: debug
|
||||
# --
|
||||
require IEx; IEx.pry
|
||||
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
|
||||
7
snippets/elixir-mode/test
Normal file
7
snippets/elixir-mode/test
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: test
|
||||
# key: test
|
||||
# --
|
||||
test "$1" do
|
||||
$0
|
||||
end
|
||||
7
snippets/elixir-mode/unless
Normal file
7
snippets/elixir-mode/unless
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: unless
|
||||
# key: unless
|
||||
# --
|
||||
unless ${1:condition} do
|
||||
$0
|
||||
end
|
||||
8
snippets/elixir-mode/wt
Normal file
8
snippets/elixir-mode/wt
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Miriam Retka (https://github.com/Auralcat)
|
||||
# name: wt
|
||||
# key: wt
|
||||
# --
|
||||
with ${1:{:ok, tuple} <- function(arg)}, do
|
||||
$0
|
||||
end
|
||||
10
snippets/elixir-mode/wte
Normal file
10
snippets/elixir-mode/wte
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: Miriam Retka (https://github.com/Auralcat)
|
||||
# name: wte
|
||||
# key: wte
|
||||
# --
|
||||
with ${1:{:ok, tuple} <- function(arg)}, do
|
||||
$2
|
||||
else
|
||||
$0
|
||||
end
|
||||
Reference in New Issue
Block a user