summary refs log tree commit diff
path: root/.vim/snippets/all.lua
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2026-02-10 12:32:48 +0100
committerRobert Günzler <r@gnzler.io>2026-02-10 12:41:25 +0100
commit63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch)
tree41cd5d2d1ec36e74e464caab722cc9b460153f04 /.vim/snippets/all.lua
parent5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff)
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.vim/snippets/all.lua')
-rw-r--r--.vim/snippets/all.lua112
1 files changed, 0 insertions, 112 deletions
diff --git a/.vim/snippets/all.lua b/.vim/snippets/all.lua
deleted file mode 100644
index 2e9d975..0000000
--- a/.vim/snippets/all.lua
+++ /dev/null
@@ -1,112 +0,0 @@
----@diagnostic disable: undefined-global
-local events = require('luasnip.util.events')
-
-local fromglob = function(pattern, opts)
-  local choices = {}
-  for _, path in ipairs(vim.fn.glob(pattern, false, true, false)) do
-    choices[#choices + 1] = f(function(_, _, uargs)
-      return vim.fn.readfile(uargs)
-    end, {}, { user_args = { path } })
-  end
-  return sn(nil, { c(1, choices, opts) })
-end
-
-local commentwrap = function(opts)
-  return vim.tbl_extend('error', opts or {}, {
-    callbacks = {
-      [-1] = {
-        [events.leave] = function(node)
-          local start_ln = node:get_buf_position()[1] + 1
-          local end_ln = start_ln + #node:get_text() - 1
-          require('vim._comment').toggle_lines(start_ln, end_ln)
-        end,
-      },
-    },
-  })
-end
-
-return {
-  -- mini symbols
-  s('check', t([[✔]])),
-  s('cross', t([[✖]])),
-  s('...', t([[…]])),
-  s('->', t([[➞ ]])),
-
-  s(
-    'memail',
-    c(1, {
-      t([[robert@gnzler.de]]),
-      t([[robert@gnzler.io]]),
-    })
-  ),
-  s('mename', t([[Robert Günzler]])),
-  s('date', exec([[date --rfc-email]])),
-  s('mfg', t([[Mit freundlichen Grüßen]])),
-  s('sehr', t([[Sehr geehrte Damen und Herren]])),
-  s('sign', t([[  - Robert]])),
-
-  s(
-    'today',
-    f(function()
-      return os.date('%Y-%m-%d')
-    end, {})
-  ),
-  s(
-    'now',
-    f(function()
-      return os.date('%Y-%m-%dT%H:%M:%SZ')
-    end, {})
-  ),
-
-  s(
-    { trig = 'license' },
-    d(1, function()
-      local pattern = vim.fn.stdpath('config') .. '/snippets/license_*.txt'
-      return fromglob(pattern, { name = 'LICENSE templates' })
-    end, nil)
-  ),
-
-  s(
-    { trig = 'spdx' },
-    d(1, function()
-      local pattern = vim.fn.stdpath('config') .. '/snippets/spdx_*.txt'
-      return fromglob(pattern, { name = 'SPDX header templates' })
-    end),
-    commentwrap(nil)
-  ),
-
-  s(
-    { trig = 'todo' },
-    isn(1, {
-      c(1, {
-        sn(nil, { i(1, 'TODO') }),
-        sn(nil, { i(1, 'NOTE') }),
-        sn(nil, { i(1, 'XXX') }),
-      }),
-      c(2, {
-        sn(nil, { i(1) }),
-        sn(nil, { t('('), i(1, 'robertgzr'), t(')') }),
-      }),
-      t(': '),
-      i(3, 'your comment here'),
-    }, ''),
-    commentwrap(nil)
-  ),
-
-  s(
-    { trig = '#!/bin' },
-    d(1, function()
-      local pattern = vim.fn.stdpath('config') .. '/snippets/sh_*.txt'
-      return fromglob(pattern, { name = 'Shell script template' })
-    end, {}),
-    {
-      callbacks = {
-        [-1] = {
-          [events.pre_expand] = function()
-            vim.opt_local.filetype = 'sh'
-          end,
-        },
-      },
-    }
-  ),
-}