summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/luasnippets
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/luasnippets')
-rw-r--r--.config/nvim/lua/luasnippets/PKGBUILD.lua36
-rw-r--r--.config/nvim/lua/luasnippets/mail.lua36
-rw-r--r--.config/nvim/lua/luasnippets/vimwiki.lua60
3 files changed, 132 insertions, 0 deletions
diff --git a/.config/nvim/lua/luasnippets/PKGBUILD.lua b/.config/nvim/lua/luasnippets/PKGBUILD.lua
new file mode 100644
index 0000000..334baf1
--- /dev/null
+++ b/.config/nvim/lua/luasnippets/PKGBUILD.lua
@@ -0,0 +1,36 @@
1local ls = require("luasnip")
2local s = ls.snippet
3local sn = ls.snippet_node
4local isn = ls.indent_snippet_node
5local t = ls.text_node
6local i = ls.insert_node
7local f = ls.function_node
8local c = ls.choice_node
9local d = ls.dynamic_node
10local r = ls.restore_node
11local events = require("luasnip.util.events")
12local ai = require("luasnip.nodes.absolute_indexer")
13local extras = require("luasnip.extras")
14local l = extras.lambda
15local rep = extras.rep
16local p = extras.partial
17local m = extras.match
18local n = extras.nonempty
19local dl = extras.dynamic_lambda
20local fmt = require("luasnip.extras.fmt").fmt
21local fmta = require("luasnip.extras.fmt").fmta
22local conds = require("luasnip.extras.expand_conditions")
23local postfix = require("luasnip.extras.postfix").postfix
24local types = require("luasnip.util.types")
25local parse = require("luasnip.util.parser").parse_snippet
26local ms = ls.multi_snippet
27local k = require("luasnip.nodes.key_indexer").new_key
28local strftime = vim.fn.strftime
29
30return {
31 s("m",
32 {
33 t("# Maintainer: Yigit Sever <yigit at yigitsever dot com>")
34 }
35 )
36}
diff --git a/.config/nvim/lua/luasnippets/mail.lua b/.config/nvim/lua/luasnippets/mail.lua
new file mode 100644
index 0000000..3d60baa
--- /dev/null
+++ b/.config/nvim/lua/luasnippets/mail.lua
@@ -0,0 +1,36 @@
1local ls = require("luasnip")
2local s = ls.snippet
3local sn = ls.snippet_node
4local isn = ls.indent_snippet_node
5local t = ls.text_node
6local i = ls.insert_node
7local f = ls.function_node
8local c = ls.choice_node
9local d = ls.dynamic_node
10local r = ls.restore_node
11local events = require("luasnip.util.events")
12local ai = require("luasnip.nodes.absolute_indexer")
13local extras = require("luasnip.extras")
14local l = extras.lambda
15local rep = extras.rep
16local p = extras.partial
17local m = extras.match
18local n = extras.nonempty
19local dl = extras.dynamic_lambda
20local fmt = require("luasnip.extras.fmt").fmt
21local fmta = require("luasnip.extras.fmt").fmta
22local conds = require("luasnip.extras.expand_conditions")
23local postfix = require("luasnip.extras.postfix").postfix
24local types = require("luasnip.util.types")
25local parse = require("luasnip.util.parser").parse_snippet
26local ms = ls.multi_snippet
27local k = require("luasnip.nodes.key_indexer").new_key
28local strftime = vim.fn.strftime
29
30return {
31 s("~",
32 {
33 t("~yigit")
34 }
35 )
36}
diff --git a/.config/nvim/lua/luasnippets/vimwiki.lua b/.config/nvim/lua/luasnippets/vimwiki.lua
new file mode 100644
index 0000000..c5e8532
--- /dev/null
+++ b/.config/nvim/lua/luasnippets/vimwiki.lua
@@ -0,0 +1,60 @@
1local ls = require("luasnip")
2local s = ls.snippet
3local sn = ls.snippet_node
4local isn = ls.indent_snippet_node
5local t = ls.text_node
6local i = ls.insert_node
7local f = ls.function_node
8local c = ls.choice_node
9local d = ls.dynamic_node
10local r = ls.restore_node
11local events = require("luasnip.util.events")
12local ai = require("luasnip.nodes.absolute_indexer")
13local extras = require("luasnip.extras")
14local l = extras.lambda
15local rep = extras.rep
16local p = extras.partial
17local m = extras.match
18local n = extras.nonempty
19local dl = extras.dynamic_lambda
20local fmt = require("luasnip.extras.fmt").fmt
21local fmta = require("luasnip.extras.fmt").fmta
22local conds = require("luasnip.extras.expand_conditions")
23local postfix = require("luasnip.extras.postfix").postfix
24local types = require("luasnip.util.types")
25local parse = require("luasnip.util.parser").parse_snippet
26local ms = ls.multi_snippet
27local k = require("luasnip.nodes.key_indexer").new_key
28local strftime = vim.fn.strftime
29
30local function clipboard()
31 local text = vim.fn.system({ 'wl-paste' })
32 local output = string.gsub(text, "^%s*(.-)%s*$", "%1")
33 return output
34end
35
36return {
37 s("datasrc",
38 {
39 t({ "= " }), i(1), t({ " =", "" }),
40 t({ "", "== Used By ==", "" }), i(2),
41 t({ "", "== URL ==", "" }), i(3),
42 t({ "", "== API ==", "" }), i(4),
43 t({ "", "=== Example ===", "" }), i(5),
44 t({ "", "== Cost ==", "" }), i(6),
45 t({ "", "== Limits ==", "" }), i(0),
46 }
47 ),
48 s("s",
49 {
50 t({ "- (" }),
51 t({ strftime("%F %R") }),
52 t({ ") " }),
53 i(1, clipboard()),
54 t({ " -- " }),
55 i(2, "Summary")
56
57 }
58 )
59}
60