2013-07-17 19:06:05 -04:00
|
|
|
snippet do
|
|
|
|
do
|
2017-02-11 08:01:38 -05:00
|
|
|
${0:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2017-05-02 08:42:08 -04:00
|
|
|
snippet put IO.puts
|
|
|
|
IO.puts "${0}"
|
|
|
|
snippet ins IO.inspect
|
|
|
|
IO.inspect ${0}
|
|
|
|
snippet insl IO.inspect with label
|
|
|
|
IO.inspect(${0}label: "${1:label}")
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet if if .. do .. end
|
|
|
|
if ${1} do
|
2017-02-11 08:01:38 -05:00
|
|
|
${0:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet if: if .. do: ..
|
2013-11-16 14:45:48 -05:00
|
|
|
if ${1:condition}, do: ${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet ife if .. do .. else .. end
|
|
|
|
if ${1:condition} do
|
2017-02-11 08:01:38 -05:00
|
|
|
${2:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
else
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet ife: if .. do: .. else:
|
2013-11-16 14:45:48 -05:00
|
|
|
if ${1:condition}, do: ${2}, else: ${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet unless unless .. do .. end
|
|
|
|
unless ${1} do
|
2017-02-11 08:01:38 -05:00
|
|
|
${0:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet unless: unless .. do: ..
|
2013-11-16 14:45:48 -05:00
|
|
|
unless ${1:condition}, do: ${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet unlesse unless .. do .. else .. end
|
|
|
|
unless ${1:condition} do
|
2017-02-11 08:01:38 -05:00
|
|
|
${2:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
else
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet unlesse: unless .. do: .. else:
|
2013-11-16 14:45:48 -05:00
|
|
|
unless ${1:condition}, do: ${2}, else: ${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet cond
|
|
|
|
cond do
|
2015-03-14 16:02:10 -04:00
|
|
|
${1} ->
|
2017-02-11 08:01:38 -05:00
|
|
|
${0:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
|
|
|
snippet case
|
|
|
|
case ${1} do
|
2015-03-14 16:02:10 -04:00
|
|
|
${2} ->
|
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-07-13 06:22:46 -04:00
|
|
|
snippet for
|
|
|
|
for ${1:item} <- ${2:items} do
|
|
|
|
${0}
|
|
|
|
end
|
2017-05-02 08:42:08 -04:00
|
|
|
snippet for:
|
|
|
|
for ${1:item} <- ${2:items}, do: ${0}
|
2015-07-13 06:22:46 -04:00
|
|
|
snippet fori
|
|
|
|
for ${1:item} <- ${2:items}, into: ${3} do
|
|
|
|
${0}
|
|
|
|
end
|
2016-10-02 07:37:21 -04:00
|
|
|
snippet wi
|
2017-05-02 08:42:08 -04:00
|
|
|
with ${1:item} <- ${2:items} do
|
2016-10-02 07:37:21 -04:00
|
|
|
${0}
|
|
|
|
end
|
|
|
|
snippet wie
|
|
|
|
with(
|
|
|
|
${1:item} <- ${2:items}
|
|
|
|
) do
|
|
|
|
${3}
|
|
|
|
else
|
|
|
|
${4} ->
|
|
|
|
${0}
|
|
|
|
end
|
2017-05-02 08:42:08 -04:00
|
|
|
snippet sp
|
|
|
|
@spec ${1:name}(${2:args}) :: ${3:returns}
|
|
|
|
snippet op
|
|
|
|
@opaque ${1:type_name} :: ${2:type}
|
|
|
|
snippet ty
|
|
|
|
@type ${1:type_name} :: ${2:type}
|
|
|
|
snippet typ
|
|
|
|
@typep ${1:type_name} :: ${2:type}
|
|
|
|
snippet cb
|
|
|
|
@callback ${1:name}(${2:args}) :: ${3:returns}
|
2014-03-02 09:35:00 -05:00
|
|
|
snippet df
|
|
|
|
def ${1:name}, do: ${2}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet def
|
|
|
|
def ${1:name} do
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet defd
|
|
|
|
@doc """
|
|
|
|
${1:doc string}
|
|
|
|
"""
|
|
|
|
def ${2:name} do
|
|
|
|
${0}
|
|
|
|
end
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet defim
|
|
|
|
defimpl ${1:protocol_name}, for: ${2:data_type} do
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
|
|
|
snippet defma
|
|
|
|
defmacro ${1:name} do
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
|
|
|
snippet defmo
|
2015-12-08 08:20:04 -05:00
|
|
|
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2016-11-09 12:22:55 -05:00
|
|
|
snippet dfp
|
|
|
|
defp ${1:name}, do: ${2}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet defp
|
|
|
|
defp ${1:name} do
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
|
|
|
snippet defpr
|
2013-11-16 14:45:48 -05:00
|
|
|
defprotocol ${1:name}, [${0:function}]
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet defr
|
2013-11-16 14:45:48 -05:00
|
|
|
defrecord ${1:record_name}, ${0:fields}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet doc
|
|
|
|
@doc """
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
"""
|
2016-11-09 12:22:55 -05:00
|
|
|
snippet docf
|
|
|
|
@doc false
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet fn
|
2015-02-24 05:45:22 -05:00
|
|
|
fn ${1:args} -> ${0} end
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet mdoc
|
|
|
|
@moduledoc """
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
"""
|
2015-12-16 08:53:53 -05:00
|
|
|
snippet mdocf
|
|
|
|
@moduledoc false
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet rec
|
|
|
|
receive do
|
2015-07-13 06:22:46 -04:00
|
|
|
${1} ->
|
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
|
|
|
snippet req
|
2013-11-16 14:45:48 -05:00
|
|
|
require ${0:module_name}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet imp
|
2013-11-16 14:45:48 -05:00
|
|
|
import ${0:module_name}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet ali
|
2013-11-16 14:45:48 -05:00
|
|
|
alias ${0:module_name}
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet test
|
2016-08-02 08:48:32 -04:00
|
|
|
test "${1:test name}" do
|
2013-11-16 14:45:48 -05:00
|
|
|
${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet testa
|
|
|
|
test "${1:test_name}", %{${2:arg: arg}} do
|
2016-03-14 06:04:57 -04:00
|
|
|
${0}
|
|
|
|
end
|
2016-08-02 08:48:32 -04:00
|
|
|
snippet des
|
|
|
|
describe "${1:test group subject}" do
|
|
|
|
${0}
|
|
|
|
end
|
2016-03-14 06:04:57 -04:00
|
|
|
snippet exunit
|
|
|
|
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
|
2016-06-11 09:56:50 -04:00
|
|
|
use ExUnit.Case, async: true
|
2016-03-14 06:04:57 -04:00
|
|
|
|
2015-02-24 05:45:22 -05:00
|
|
|
${0}
|
|
|
|
end
|
2013-07-17 19:06:05 -04:00
|
|
|
snippet try try .. rescue .. end
|
|
|
|
try do
|
2017-02-11 08:01:38 -05:00
|
|
|
${1:${VISUAL}}
|
2013-07-17 19:06:05 -04:00
|
|
|
rescue
|
2013-11-16 14:45:48 -05:00
|
|
|
${2} -> ${0}
|
2013-07-17 19:06:05 -04:00
|
|
|
end
|
2015-02-24 05:45:22 -05:00
|
|
|
snippet pry
|
|
|
|
require IEx; IEx.pry
|
2015-03-14 16:02:10 -04:00
|
|
|
${0}
|
2015-12-08 08:20:04 -05:00
|
|
|
snippet qu
|
|
|
|
quote do
|
|
|
|
${1}
|
|
|
|
end
|
2016-06-11 09:56:50 -04:00
|
|
|
snippet beh
|
|
|
|
@behaviour ${1:Mix.Task}
|
|
|
|
${0}
|
2017-05-02 08:42:08 -04:00
|
|
|
snippet >e pipe to each
|
|
|
|
|> Enum.each(fn ${1} -> ${0} end)
|
|
|
|
snippet >m pipe to map
|
|
|
|
|> Enum.map(fn ${1} -> ${0} end)
|
|
|
|
snippet >f pipe to filter
|
|
|
|
|> Enum.filter(fn ${1} -> ${0} end)
|
|
|
|
snippet >r pipe to reduce
|
|
|
|
|> Enum.reduce(${1:acc}, fn ${2}, ${3:acc} -> ${0} end)
|
|
|
|
snippet >i pipe to inspect
|
|
|
|
|> IO.inspect
|
|
|
|
snippet >il pipe to inspect with label
|
|
|
|
|> IO.inspect(label: "${1:label}")
|