mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -3,9 +3,9 @@ snippet do
|
||||
${0:${VISUAL}}
|
||||
end
|
||||
snippet put IO.puts
|
||||
IO.puts "${0}"
|
||||
IO.puts("${0}")
|
||||
snippet ins IO.inspect
|
||||
IO.inspect ${0}
|
||||
IO.inspect(${0})
|
||||
snippet insl IO.inspect with label
|
||||
IO.inspect(${0}label: "${1:label}")
|
||||
snippet if if .. do .. end
|
||||
@ -247,7 +247,7 @@ snippet >f pipe to filter
|
||||
snippet >r pipe to reduce
|
||||
|> Enum.reduce(${1:acc}, fn ${2}, ${3:acc} -> ${0} end)
|
||||
snippet >i pipe to inspect
|
||||
|> IO.inspect
|
||||
|> IO.inspect()
|
||||
snippet >il pipe to inspect with label
|
||||
|> IO.inspect(label: "${1:label}")
|
||||
snippet cs
|
||||
@ -265,22 +265,27 @@ snippet genserver basic genserver structure
|
||||
use GenServer
|
||||
|
||||
@doc false
|
||||
def start_link do
|
||||
GenServer.start_link(__MODULE__, ${1:Map.new})
|
||||
def start_link(init_args) do
|
||||
GenServer.start_link(__MODULE__, init_args, name: __MODULE__)
|
||||
end
|
||||
|
||||
@impl true
|
||||
def init(state) do
|
||||
{:ok, state}
|
||||
end
|
||||
snippet genserver: basic genserver structure
|
||||
use GenServer
|
||||
snippet super basic supervisor structure
|
||||
use Supervisor
|
||||
|
||||
@doc false
|
||||
def start_link, do: GenServer.start_link(__MODULE__, ${1:Map.new})
|
||||
def start_link(init_args) do
|
||||
Supervisor.start_link(__MODULE__, init_args, name: __MODULE__)
|
||||
end
|
||||
|
||||
@impl true
|
||||
def init(state), do: {:ok, state}
|
||||
def init(_init_args) do
|
||||
children = [${1}]
|
||||
Supervisor.init(children, strategy: :one_for_one)
|
||||
end
|
||||
snippet impl
|
||||
@impl true
|
||||
def ${1:name} do
|
||||
|
Reference in New Issue
Block a user