1
0
Fork 0
mirror of synced 2024-11-26 18:55:34 -05:00
ultimate-vim/sources_non_forked/vim-snippets/snippets/elixir.snippets

137 lines
2.1 KiB
Text
Raw Normal View History

2013-07-17 19:06:05 -04:00
snippet do
do
${0}
2013-07-17 19:06:05 -04:00
end
snippet if if .. do .. end
if ${1} do
${0}
2013-07-17 19:06:05 -04:00
end
2015-02-24 05:45:22 -05:00
snippet if: if .. do: ..
if ${1:condition}, do: ${0}
2013-07-17 19:06:05 -04:00
snippet ife if .. do .. else .. end
if ${1:condition} do
${2}
else
${0}
2013-07-17 19:06:05 -04:00
end
2015-02-24 05:45:22 -05:00
snippet ife: if .. do: .. else:
if ${1:condition}, do: ${2}, else: ${0}
2013-07-17 19:06:05 -04:00
snippet unless unless .. do .. end
unless ${1} do
${0}
2013-07-17 19:06:05 -04:00
end
2015-02-24 05:45:22 -05:00
snippet unless: unless .. do: ..
unless ${1:condition}, do: ${0}
2013-07-17 19:06:05 -04:00
snippet unlesse unless .. do .. else .. end
unless ${1:condition} do
${2}
else
${0}
2013-07-17 19:06:05 -04:00
end
2015-02-24 05:45:22 -05:00
snippet unlesse: unless .. do: .. else:
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} ->
${0}
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
snippet fori
for ${1:item} <- ${2:items}, into: ${3} do
${0}
end
snippet df
def ${1:name}, do: ${2}
2013-07-17 19:06:05 -04:00
snippet def
def ${1:name} do
${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
${0}
2013-07-17 19:06:05 -04:00
end
snippet defma
defmacro ${1:name} do
${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
${0}
2013-07-17 19:06:05 -04:00
end
snippet defp
defp ${1:name} do
${0}
2013-07-17 19:06:05 -04:00
end
snippet defpr
defprotocol ${1:name}, [${0:function}]
2013-07-17 19:06:05 -04:00
snippet defr
defrecord ${1:record_name}, ${0:fields}
2013-07-17 19:06:05 -04:00
snippet doc
@doc """
${0}
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 """
${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
require ${0:module_name}
2013-07-17 19:06:05 -04:00
snippet imp
import ${0:module_name}
2013-07-17 19:06:05 -04:00
snippet ali
alias ${0:module_name}
2013-07-17 19:06:05 -04:00
snippet test
test "${1:test_name}" do
${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
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
${1}
rescue
${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}