2013-06-25 21:40:02 -03:00
|
|
|
snippet do
|
|
|
|
do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-25 21:40:02 -03:00
|
|
|
end
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet if if .. do .. end
|
|
|
|
if ${1} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
2015-02-21 11:24:27 +00:00
|
|
|
snippet if: if .. do: ..
|
2013-07-25 17:17:32 -04:00
|
|
|
if ${1:condition}, do: ${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet ife if .. do .. else .. end
|
|
|
|
if ${1:condition} do
|
|
|
|
${2}
|
|
|
|
else
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
2015-02-21 11:24:27 +00:00
|
|
|
snippet ife: if .. do: .. else:
|
2013-07-25 17:17:32 -04:00
|
|
|
if ${1:condition}, do: ${2}, else: ${0}
|
2013-06-01 22:43:20 -03:00
|
|
|
snippet unless unless .. do .. end
|
|
|
|
unless ${1} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 22:43:20 -03:00
|
|
|
end
|
2015-02-21 11:24:27 +00:00
|
|
|
snippet unless: unless .. do: ..
|
2013-07-25 17:17:32 -04:00
|
|
|
unless ${1:condition}, do: ${0}
|
2013-06-01 22:43:20 -03:00
|
|
|
snippet unlesse unless .. do .. else .. end
|
|
|
|
unless ${1:condition} do
|
|
|
|
${2}
|
|
|
|
else
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 22:43:20 -03:00
|
|
|
end
|
2015-02-21 11:24:27 +00:00
|
|
|
snippet unlesse: unless .. do: .. else:
|
2013-07-25 17:17:32 -04:00
|
|
|
unless ${1:condition}, do: ${2}, else: ${0}
|
2013-06-01 22:43:20 -03:00
|
|
|
snippet cond
|
|
|
|
cond do
|
2015-03-04 10:18:54 +00:00
|
|
|
${1} ->
|
|
|
|
${0}
|
2013-06-01 22:43:20 -03:00
|
|
|
end
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet case
|
|
|
|
case ${1} do
|
2015-03-04 10:18:54 +00:00
|
|
|
${2} ->
|
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
2015-04-05 11:40:05 +01:00
|
|
|
snippet for
|
|
|
|
for ${1:item} <- ${2:items} do
|
|
|
|
${0}
|
|
|
|
end
|
|
|
|
snippet fori
|
|
|
|
for ${1:item} <- ${2:items}, into: ${3} do
|
|
|
|
${0}
|
|
|
|
end
|
2016-09-29 20:36:20 +01:00
|
|
|
snippet wi
|
|
|
|
with(
|
|
|
|
${1:item} <- ${2:items}
|
|
|
|
) do
|
|
|
|
${0}
|
|
|
|
end
|
|
|
|
snippet wie
|
|
|
|
with(
|
|
|
|
${1:item} <- ${2:items}
|
|
|
|
) do
|
|
|
|
${3}
|
|
|
|
else
|
|
|
|
${4} ->
|
|
|
|
${0}
|
|
|
|
end
|
2014-02-21 07:02:23 +01:00
|
|
|
snippet df
|
2014-02-26 16:41:19 +01:00
|
|
|
def ${1:name}, do: ${2}
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet def
|
|
|
|
def ${1:name} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
2015-02-19 18:01:49 +00:00
|
|
|
snippet defd
|
|
|
|
@doc """
|
|
|
|
${1:doc string}
|
|
|
|
"""
|
|
|
|
def ${2:name} do
|
|
|
|
${0}
|
|
|
|
end
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet defim
|
|
|
|
defimpl ${1:protocol_name}, for: ${2:data_type} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
|
|
|
snippet defma
|
|
|
|
defmacro ${1:name} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
|
|
|
snippet defmo
|
2015-10-25 22:33:04 +01:00
|
|
|
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
|
|
|
snippet defp
|
|
|
|
defp ${1:name} do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
|
|
|
snippet defpr
|
2013-07-25 17:17:32 -04:00
|
|
|
defprotocol ${1:name}, [${0:function}]
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet defr
|
2013-07-25 17:17:32 -04:00
|
|
|
defrecord ${1:record_name}, ${0:fields}
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet doc
|
|
|
|
@doc """
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
"""
|
|
|
|
snippet fn
|
2015-02-19 18:02:46 +00:00
|
|
|
fn ${1:args} -> ${0} end
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet mdoc
|
|
|
|
@moduledoc """
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
"""
|
2015-12-15 22:21:45 +00:00
|
|
|
snippet mdocf
|
|
|
|
@moduledoc false
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet rec
|
|
|
|
receive do
|
2015-04-27 12:34:58 +02:00
|
|
|
${1} ->
|
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
|
|
|
snippet req
|
2013-07-25 17:17:32 -04:00
|
|
|
require ${0:module_name}
|
2013-06-01 22:43:20 -03:00
|
|
|
snippet imp
|
2013-07-25 17:17:32 -04:00
|
|
|
import ${0:module_name}
|
2013-06-01 22:43:20 -03:00
|
|
|
snippet ali
|
2013-07-25 17:17:32 -04:00
|
|
|
alias ${0:module_name}
|
2013-06-01 10:39:30 -03:00
|
|
|
snippet test
|
2016-07-29 13:06:07 +01:00
|
|
|
test "${1:test name}" do
|
2013-07-25 17:17:32 -04:00
|
|
|
${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
2015-02-20 09:27:15 +00:00
|
|
|
snippet testa
|
2015-02-19 18:39:26 +00:00
|
|
|
test "${1:test_name}", %{${2:arg: arg}} do
|
2016-03-13 18:12:25 +00:00
|
|
|
${0}
|
|
|
|
end
|
2016-07-29 13:06:07 +01:00
|
|
|
snippet des
|
|
|
|
describe "${1:test group subject}" do
|
|
|
|
${0}
|
|
|
|
end
|
2016-03-13 18:12:25 +00:00
|
|
|
snippet exunit
|
|
|
|
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
|
2016-05-26 23:57:22 +01:00
|
|
|
use ExUnit.Case, async: true
|
2016-03-13 18:12:25 +00:00
|
|
|
|
2015-02-19 18:39:26 +00:00
|
|
|
${0}
|
|
|
|
end
|
2013-06-01 22:43:20 -03:00
|
|
|
snippet try try .. rescue .. end
|
2013-06-01 10:39:30 -03:00
|
|
|
try do
|
2013-06-01 22:43:20 -03:00
|
|
|
${1}
|
|
|
|
rescue
|
2013-07-25 17:17:32 -04:00
|
|
|
${2} -> ${0}
|
2013-06-01 10:39:30 -03:00
|
|
|
end
|
2015-02-20 16:03:05 +00:00
|
|
|
snippet pry
|
|
|
|
require IEx; IEx.pry
|
2015-02-27 00:15:59 +00:00
|
|
|
${0}
|
2015-10-07 10:08:48 +02:00
|
|
|
snippet qu
|
|
|
|
quote do
|
|
|
|
${1}
|
|
|
|
end
|
2016-05-29 20:51:58 +01:00
|
|
|
snippet beh
|
|
|
|
@behaviour ${1:Mix.Task}
|
|
|
|
${0}
|