This commit is contained in:
2024-04-30 07:08:23 +02:00
commit a711247971
2043 changed files with 16874 additions and 0 deletions

View File

@@ -0,0 +1 @@
prog-mode

View File

@@ -0,0 +1,6 @@
## -*- mode: snippet -*-
# name: after
# key: after
# --
after ${1:500} ->
$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: call
# key: call
# --
GenServer.call(${1:__MODULE__}, $0)

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: case
# key: case
# --
case $1 do
$0
end

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: cast
# key: cast
# --
GenServer.cast(${1:__MODULE__}, $0)

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: cond
# key: cond
# --
cond do
$0
end

7
snippets/elixir-mode/def Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: def
# key: def
# --
def ${1:function}${2:(${3:args})} do
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: defmacro
# key: defmacro
# --
defmacro $1 do
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: defmacrop
# key: defmacrop
# --
defmacrop $1 do
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: defmodule
# key: defmodule
# --
defmodule $1 do
$0
end

View 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

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: defp
# key: defp
# --
defp $1 do
$0
end

7
snippets/elixir-mode/do Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: do
# key: do
# --
do
$0
end

7
snippets/elixir-mode/doc Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: doc
# key: doc
# --
@doc """
$0
"""

5
snippets/elixir-mode/fn Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: fn
# key: fn
# --
fn ${1:x} -> $1$0 end

7
snippets/elixir-mode/for Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for
# key: for
# --
for ${2:x} <- ${1:enum} do
$2$0
end

View 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

View 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

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: hcall
# key: hcall
# --
def handle_call($1, _from, ${2:state}) do
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: hcast
# key: hcast
# --
def handle_cast($1, ${2:state}) do
$0
end

View 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
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: if
# key: if
# --
if ${1:condition} do
$0
end

9
snippets/elixir-mode/ife Normal file
View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: if-else
# key: ife
# --
if ${1:condition} do
$2
else
$3
end

View 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
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: io
# key: io
# --
IO.puts("$1")$0

5
snippets/elixir-mode/iop Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: iop
# key: iop
# --
IO.puts("$1 #{inspect $1}")$0

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: moduledoc
# key: mdoc
# --
@moduledoc """
$0
"""

6
snippets/elixir-mode/pry Normal file
View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: pry
# key: pry
# group: debug
# --
require IEx; IEx.pry

View File

@@ -0,0 +1,7 @@
## -*- mode: snippet -*-
# name: receive
# key: rcv
# --
receive do
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: test
# key: test
# --
test "$1" do
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: unless
# key: unless
# --
unless ${1:condition} do
$0
end

8
snippets/elixir-mode/wt Normal file
View 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
View 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