diff options
| author | Robert Günzler <r@gnzler.io> | 2026-02-10 12:32:48 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-02-10 12:41:25 +0100 |
| commit | 63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch) | |
| tree | 41cd5d2d1ec36e74e464caab722cc9b460153f04 /.vim | |
| parent | 5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff) | |
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '')
59 files changed, 133 insertions, 2064 deletions
diff --git a/.vim/.editorconfig b/.config/nvim/.editorconfig index c0b69e9..c0b69e9 100644 --- a/.vim/.editorconfig +++ b/.config/nvim/.editorconfig diff --git a/.vim/.stylua.toml b/.config/nvim/.stylua.toml index 616d360..616d360 100644 --- a/.vim/.stylua.toml +++ b/.config/nvim/.stylua.toml diff --git a/.vim/plugin/diagnostics.lua b/.config/nvim/lua/config/diagnostics.lua index 93ee621..6314b83 100644 --- a/.vim/plugin/diagnostics.lua +++ b/.config/nvim/lua/config/diagnostics.lua @@ -1,10 +1,10 @@ vim.diagnostic.config({ signs = { text = { - [vim.diagnostic.severity.ERROR] = '✗', - [vim.diagnostic.severity.WARN] = '▷', - [vim.diagnostic.severity.INFO] = 'ℹ', - [vim.diagnostic.severity.HINT] = '🞶', + [vim.diagnostic.severity.ERROR] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.HINT] = '', }, linehl = { -- [vim.diagnostic.severity.ERROR] = 'Search', @@ -44,7 +44,9 @@ end, { desc = 'diagnostic: prev' }) vim.keymap.set('n', 'DD', vim.diagnostic.open_float, { desc = 'diagnostic: current line' }) -vim.keymap.set('n', '<leader>td', function() +vim.keymap.set('n', '<leader>d', '<nop>', { desc = "diagnostics" }) +vim.keymap.set('n', '<leader>dd', vim.diagnostic.open_float, { desc = 'diagnostic: current line' }) +vim.keymap.set('n', '<leader>dv', function() -- NOTE: this can be used to switch between multiple sets of diagnostics display -- currently it only toggles virtual_text local visible = vim.diagnostic.config().virtual_text @@ -58,6 +60,6 @@ vim.keymap.set('n', '<leader>td', function() end end, { desc = 'diagnostic: toggle visibility' }) -vim.keymap.set('n', '<leader>tD', function() +vim.keymap.set('n', '<leader>da', function() vim.diagnostic.enable(not vim.diagnostic.is_enabled()) end, { desc = 'diagnostic: toggle all' }) diff --git a/.vim/plugin/options.lua b/.config/nvim/lua/config/options.lua index dba726a..073835f 100644 --- a/.vim/plugin/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -15,13 +15,13 @@ opt.listchars:append({ trail = '¬', tab = '> ', -- space = '·', - lead = '·', + -- lead = '·', }) opt.showbreak = '↪ ' -- show indicator and wrap text at 80 chars opt.colorcolumn = '+1' -opt.textwidth = 79 +opt.textwidth = 80 opt.wrap = true opt.conceallevel = 2 diff --git a/.vim/lua/internal/snippets.lua b/.config/nvim/lua/config/snippets.lua index be00884..e0c260e 100644 --- a/.vim/lua/internal/snippets.lua +++ b/.config/nvim/lua/config/snippets.lua @@ -1,72 +1,12 @@ local ls = require('luasnip') local types = require('luasnip.util.types') --- attach to builtin snippet hooks - -vim.snippet.expand = ls.lsp_expand - ----@diagnostic disable-next-line: duplicate-set-field -vim.snippet.active = function(filter) - filter = filter or {} - filter.direction = filter.direction or 1 - - if filter.direction == 1 then - return ls.expand_or_jumpable() - else - return ls.jumpable(filter.direction) - end -end - ----@diagnostic disable-next-line: duplicate-set-field -vim.snippet.jump = function(direction) - if direction == 1 then - if ls.expandable() then - return ls.expand_or_jump() - else - return ls.jumpable(1) and ls.jump(1) - end - else - return ls.jumpable(-1) and ls.jump(-1) - end -end - -vim.snippet.stop = ls.unlink_current - -local snip_env = { - -- snippet helpers - nl = function() - return ls.t({ '', '' }) - end, - exec = function(command) - return ls.f(function(_, _, ...) - local job = require('plenary.job'):new({ - command = vim.env.SHELL, - args = { '-c', ... }, - enable_recording = true, - }) - local res, exitcode = job:sync() - if not exitcode == 0 or #res == 0 then - error(string.format('exec "%s" failed', ...)) - end - return res - end, {}, { user_args = { command } }) - end, - -- condition helpers - cond = { - ts = function(capture) - return function() - return vim.tbl_contains(vim.treesitter.get_captures_at_cursor(), capture) - end - end, - }, -} - +-- configure luasnip ls.config.set_config({ enable_autosnippets = true, history = true, updateevents = 'TextChanged,TextChangedI', override_builtin = true, - snip_env = vim.tbl_deep_extend('error', ls.session.config.snip_env, snip_env), ext_opts = { [types.choiceNode] = { active = { @@ -79,10 +19,41 @@ ls.config.set_config({ }, }, }, + snip_env = vim.tbl_deep_extend('error', ls.session.config.snip_env, { + -- snippet helpers + nl = function() + return ls.t({ '', '' }) + end, + exec = function(command) + return ls.f(function(_, _, ...) + local job = require('plenary.job'):new({ + command = vim.env.SHELL, + args = { '-c', ... }, + enable_recording = true, + }) + local res, exitcode = job:sync() + if not exitcode == 0 or #res == 0 then + error(string.format('exec "%s" failed', ...)) + end + return res + end, {}, { user_args = { command } }) + end, + -- condition helpers + cond = { + ts = function(capture) + return function() + return vim.tbl_contains(vim.treesitter.get_captures_at_cursor(), capture) + end + end, + }, + }), }) -require('luasnip.loaders.from_lua').lazy_load({ paths = './snippets' }) +-- snippet loaders +require('luasnip.loaders.from_lua').lazy_load() +require('luasnip.loaders.from_vscode').lazy_load({ include = {} }) +-- keymaps vim.keymap.set({ 'i', 's' }, '<c-j>', function() return vim.snippet.active({ direction = 1 }) and vim.snippet.jump(1) end, { silent = true, desc = 'snippet: jump next' }) @@ -103,8 +74,10 @@ vim.keymap.set({ 'i', 's' }, '<c-p>', function() end end, { silent = true, desc = 'snippet: prev choice' }) +-- usercmds vim.api.nvim_create_user_command('EditSnippets', require('luasnip.loaders').edit_snippet_files, {}) +-- autocmds -- vim.api.nvim_create_autocmd('User', { -- pattern = 'LuasnipChoiceNodeEnter', -- callback = function() @@ -127,3 +100,41 @@ vim.api.nvim_create_user_command('EditSnippets', require('luasnip.loaders').edit -- end) -- end, -- }) + +-- unlink luasnip session on <esc> +vim.api.nvim_create_autocmd('ModeChanged', { + pattern = '*', + callback = function() + if ((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i') + and ls.session.current_nodes[vim.api.nvim_get_current_buf()] + and not ls.session.jump_active + and not require("blink.cmp").is_visible() + then + ls.unlink_current() + end + end +}) + +-- attach to builtin snippet hooks +vim.snippet.expand = ls.lsp_expand +vim.snippet.active = function(filter) + filter = filter or {} + filter.direction = filter.direction or 1 + if filter.direction == 1 then + return ls.expand_or_jumpable() + else + return ls.jumpable(filter.direction) + end +end +vim.snippet.jump = function(direction) + if direction == 1 then + if ls.expandable() then + return ls.expand_or_jump() + else + return ls.jumpable(1) and ls.jump(1) + end + else + return ls.jumpable(-1) and ls.jump(-1) + end +end +vim.snippet.stop = ls.unlink_current diff --git a/.vim/plugin/statuscolumn.lua b/.config/nvim/lua/config/statuscolumn.lua index 06e8988..06e8988 100644 --- a/.vim/plugin/statuscolumn.lua +++ b/.config/nvim/lua/config/statuscolumn.lua diff --git a/.vim/plugin/statusline.lua b/.config/nvim/lua/config/statusline.lua index fed6d33..fed6d33 100644 --- a/.vim/plugin/statusline.lua +++ b/.config/nvim/lua/config/statusline.lua diff --git a/.vim/plugin/undo.lua b/.config/nvim/lua/config/undo.lua index aed6195..aed6195 100644 --- a/.vim/plugin/undo.lua +++ b/.config/nvim/lua/config/undo.lua diff --git a/.vim/lua/internal/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua index 1d0e0ae..1122bcc 100644 --- a/.vim/lua/internal/plugins/blink.lua +++ b/.config/nvim/lua/plugins/blink.lua @@ -6,14 +6,7 @@ return { lazy = false, dependencies = { - { - 'L3MON4D3/LuaSnip', - version = 'v2.*', - build = 'make install_jsregexp', - config = function() - require('internal.snippets') - end, - }, + { 'L3MON4D3/LuaSnip' }, }, init = function() @@ -26,11 +19,29 @@ return { hl(0, 'BlinkCmpLabelDescription', { link = 'Comment', force = true }) end, + opts_extend = { 'sources.default' }, + opts = { -- TODO: -- 'prefer_rust_with_warning', requires nightly rust, due to: -- https://github.com/rust-lang/rust/issues/86656 - fuzzy = { implementation = 'lua' }, + fuzzy = { + implementation = 'lua', + sorts = { + function(a, b) + local prio = { + snippets = 99, + -- everyting else 0 + } + local a_priority = prio[a.source_id] or 0 + local b_priority = prio[b.source_id] or 0 + if a_priority ~= b_priority then return a_priority > b_priority end + end, + -- defaults + 'score', + 'sort_text' + }, + }, appearance = { -- fallback to cmp highlight names @@ -42,7 +53,6 @@ return { sources = { providers = { buffer = { min_keyword_length = 3 }, - snippets = { min_keyword_length = 3 }, }, }, @@ -80,6 +90,5 @@ return { snippets = { preset = 'luasnip' }, }, - opts_extend = { 'sources.default' }, }, } diff --git a/.vim/lua/internal/plugins/colorizer.lua b/.config/nvim/lua/plugins/colorizer.lua index cf55336..2608ae6 100644 --- a/.vim/lua/internal/plugins/colorizer.lua +++ b/.config/nvim/lua/plugins/colorizer.lua @@ -2,12 +2,11 @@ return { { 'NvChad/nvim-colorizer.lua', -- 'norcalli/nvim-colorizer.lua', - -- events = { 'VeryLazy' }, lazy = false, opts = { name = true, RRGGBB = true, - RRGGBBAA = false, + RRGGBBAA = true, rgb_fn = true, hsl_fn = true, mode = 'background', diff --git a/.vim/lua/internal/plugins/fzf.lua b/.config/nvim/lua/plugins/fzf.lua index e8c0a9c..efee6ef 100644 --- a/.vim/lua/internal/plugins/fzf.lua +++ b/.config/nvim/lua/plugins/fzf.lua @@ -28,11 +28,19 @@ return { ['ctrl-p'] = 'up', }, }, + -- actions = { + -- files = { + -- ['ctrl-q'] = { fn = fzf.actions.file_sel_to_qf }, + -- }, + -- }, fzf_colors = true, -- PICKER CONFIG files = { file_icons = true, }, + marks = { + marks = '[a-zA-Z]', + } }) end, keys = { @@ -41,8 +49,12 @@ return { { mode = 'n', ';b', '<cmd>FzfLua buffers<cr>', desc = 'fzf: buffers' }, { mode = 'n', ';f', '<cmd>FzfLua files<cr>', desc = 'fzf: find_files' }, { mode = 'n', ';g', '<cmd>FzfLua live_grep<cr>', desc = 'fzf: live_grep' }, - { mode = 'n', ';d', '<cmd>FzfLua diagnostics_workspace<cr>', desc = 'fzf: diagnostics' }, - { mode = 'n', ';h', '<cmd>FzfLua helptags<cr>', desc = 'fzf: diagnostics' }, + { mode = 'n', ';d', '<cmd>FzfLua diagnostics_workspace<cr>', desc = 'fzf: workspace diagnostics' }, + { mode = 'n', ';D', '<cmd>FzfLua diagnostics_document<cr>', desc = 'fzf: document diagnostics' }, + { mode = 'n', ';h', '<cmd>FzfLua helptags<cr>', desc = 'fzf: help' }, + { mode = 'n', ';s', '<cmd>FzfLua lsp_document_symbols<cr>', desc = 'fzf: document symbols' }, + { mode = 'n', ';w', '<cmd>FzfLua lsp_live_workspace_symbols<cr>', desc = 'fzf: workspace symbols' }, + { mode = 'n', ';m', '<cmd>FzfLua marks<cr>', desc = 'fzf: marks' }, { mode = 'n', ';v', diff --git a/.vim/lua/internal/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 056cc14..2561ad9 100644 --- a/.vim/lua/internal/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -3,10 +3,7 @@ return { 'lewis6991/gitsigns.nvim', lazy = false, opts = { - signs = { - change = { text = '▋' }, - add = { text = '▋' }, - }, + debug_mode = false, }, keys = { { @@ -31,8 +28,12 @@ return { end, desc = 'Gitsigns: prev hunk', }, + { '<leader>g', '<nop>', desc = 'git' }, + { '<leader>g<space>', '<cmd>Gitsigns<cr>', desc = 'Gitsigns: select action' }, { '<leader>gb', '<cmd>Gitsigns blame<cr>', desc = 'Gitsigns: blame' }, - { '<leader>gs', '<cmd>Gitsigns<cr>', desc = 'Gitsigns: select action' }, + { '<leader>ga', '<cmd>Gitsigns stage_hunk<cr>', desc = 'Gitsigns: stage hunk' }, + { '<leader>ga', ':Gitsigns stage_hunk<cr>', desc = 'Gitsigns: stage hunk', mode = 'x' }, + { '<leader>gd', ':Gitsigns diffthis<cr>', desc = 'Gitsigns: diff' }, { ';c', function() diff --git a/.vim/lua/internal/plugins/icons.lua b/.config/nvim/lua/plugins/icons.lua index 9a597ab..9a597ab 100644 --- a/.vim/lua/internal/plugins/icons.lua +++ b/.config/nvim/lua/plugins/icons.lua diff --git a/.vim/lua/internal/plugins/indent.lua b/.config/nvim/lua/plugins/indent.lua index a27a328..e247c5a 100644 --- a/.vim/lua/internal/plugins/indent.lua +++ b/.config/nvim/lua/plugins/indent.lua @@ -12,11 +12,13 @@ return { enabled = true, show_start = false, show_end = false, + char = '▌', }, }, }, -- detect indent from the buffer contents { + enabled = false, 'NMAC427/guess-indent.nvim', lazy = false, opts = { diff --git a/.vim/lua/internal/plugins/mini.lua b/.config/nvim/lua/plugins/mini.lua index fb4c9a6..fb4c9a6 100644 --- a/.vim/lua/internal/plugins/mini.lua +++ b/.config/nvim/lua/plugins/mini.lua diff --git a/.vim/lua/internal/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 401fe8b..401fe8b 100644 --- a/.vim/lua/internal/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua diff --git a/.vim/lua/internal/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index b8b1d56..93f396d 100644 --- a/.vim/lua/internal/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,41 +1,24 @@ return { { 'nvim-treesitter/nvim-treesitter', + branch = 'master', dependencies = { - -- TODO: https://github.com/nvim-treesitter/nvim-treesitter-context { 'nvim-treesitter/nvim-treesitter-refactor', lazy = false }, { 'nvim-treesitter/nvim-treesitter-textobjects', lazy = false }, - { 'nvim-treesitter/playground', cmd = { 'TSPlayground' } }, + -- { 'nvim-treesitter/playground', cmd = { 'TSPlayground' } }, }, lazy = false, build = ':TSUpdate', config = function(_, opts) - -- TODO: overwrite parser configs, insert gotmpl - require('nvim-treesitter.configs').setup(opts) -- use bash parser for gentoo ebuilds vim.treesitter.language.register('bash', 'ebuild') - - -- register mediawiki parser - -- local parser_configs = require('nvim-treesitter.parsers').get_parser_configs() - -- parser_configs.mediawiki = { - -- install_info = { - -- url = 'github.com/Ordoviz/tree-sitter-mediawiki', - -- files = { 'src/parser.c' }, - -- branch = 'main', - -- generate_requires_npm = false, - -- requires_generate_from_grammar = false, - -- }, - -- filetype = 'mediawiki', - -- } end, opts = { ensure_installed = { 'bash', - 'bibtex', 'c', - 'c_sharp', 'cmake', 'comment', 'cpp', @@ -45,37 +28,28 @@ return { 'gomod', 'gotmpl', 'gowork', - 'hare', - 'hcl', 'html', - 'java', 'javascript', 'json', 'jsonc', - 'kotlin', - 'latex', - 'ledger', 'lua', 'make', 'markdown', 'markdown_inline', 'ninja', - 'norg', 'python', - 'query', 'regex', 'rust', 'scss', 'sql', + 'todotxt', 'toml', 'typescript', + 'typst', 'vim', 'vimdoc', 'yaml', 'zig', - - -- external parsers - -- 'mediawiki', -- TODO: missing queries }, highlight = { enable = true, @@ -87,15 +61,9 @@ return { refactor = { navigation = { enable = true, - keymaps = { - goto_definition = 'gd', - }, }, smart_rename = { enable = true, - keymaps = { - smart_rename = 'grr', - }, }, }, textobjects = { @@ -112,7 +80,8 @@ return { ['al'] = '@loop.outer', ['is'] = '@scopename.inner', ['as'] = '@scopename.outer', - ['ic'] = '@comment.outer', + ['ic'] = '@comment.inner', + ['ac'] = '@comment.outer', }, selection_mode = { ['@comment.outer'] = 'V', diff --git a/.vim/lua/internal/plugins/whichkey.lua b/.config/nvim/lua/plugins/whichkey.lua index dc21eda..dc21eda 100644 --- a/.vim/lua/internal/plugins/whichkey.lua +++ b/.config/nvim/lua/plugins/whichkey.lua diff --git a/.vim b/.vim new file mode 120000 index 0000000..9fb2b6e --- /dev/null +++ b/.vim @@ -0,0 +1 @@ +/home/robert/.config/nvim \ No newline at end of file diff --git a/.vim/after/ftplugin/c.lua b/.vim/after/ftplugin/c.lua deleted file mode 100644 index 8b2cea9..0000000 --- a/.vim/after/ftplugin/c.lua +++ /dev/null @@ -1 +0,0 @@ -vim.opt_local.commentstring = '// %s' diff --git a/.vim/after/ftplugin/html.lua b/.vim/after/ftplugin/html.lua deleted file mode 100644 index 35f0bd1..0000000 --- a/.vim/after/ftplugin/html.lua +++ /dev/null @@ -1,20 +0,0 @@ -local function get_visual_selection() - local start_pos = vim.fn.getpos('v') - local end_pos = vim.fn.getpos('.') - local text = vim.fn.getregion(vim.fn.getpos('v'), vim.fn.getpos('.'), { type = vim.fn.mode() }) - return { start_pos = start_pos, end_pos = end_pos, text = text } -end - -vim.keymap.set('x', '<c-l>', function() - local sel = get_visual_selection() - vim.print(sel) - vim.api.nvim_buf_set_text( - sel.start_pos[1], -- bufnum - sel.start_pos[2] - 1, -- vim.api funcs use 0-based indexing - sel.start_pos[3] - 1, - sel.end_pos[2] - 1, - sel.end_pos[3], - { '<a href="TODO">' .. table.concat(sel.text, '') .. '</a>' } - ) - vim.api.nvim_input('<esc>') -end, { desc = 'html: make link' }) diff --git a/.vim/after/ftplugin/lua.lua b/.vim/after/ftplugin/lua.lua deleted file mode 100644 index ff08e11..0000000 --- a/.vim/after/ftplugin/lua.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.keymap.set('n', '<leader><leader>x', '<cmd>source %<cr>', { desc = 'Reload buf' }) -vim.keymap.set('n', '<leader><leader>X', ':Lazy reload ', { desc = 'Reload plugin' }) diff --git a/.vim/after/ftplugin/mail.lua b/.vim/after/ftplugin/mail.lua deleted file mode 100644 index fba17a2..0000000 --- a/.vim/after/ftplugin/mail.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.opt_local.cursorline = false -vim.opt_local.commentstring = '> %s' diff --git a/.vim/after/ftplugin/markdown.lua b/.vim/after/ftplugin/markdown.lua deleted file mode 100644 index 9b98392..0000000 --- a/.vim/after/ftplugin/markdown.lua +++ /dev/null @@ -1,6 +0,0 @@ --- TODO: no idea if this is the best way to do this --- the part that makes this work lives in ../../../after/ftplugin/markdown.lua -require('null-ls').disable('vale') -vim.keymap.set('n', '<leader>v', function() - require('null-ls').toggle('vale') -end) diff --git a/.vim/after/ftplugin/mediawiki.lua b/.vim/after/ftplugin/mediawiki.lua deleted file mode 100644 index 5011e85..0000000 --- a/.vim/after/ftplugin/mediawiki.lua +++ /dev/null @@ -1,5 +0,0 @@ -vim.opt.wrap = true -vim.opt.linebreak = true - -vim.keymap.set({ 'n', 'v' }, 'j', 'gj', { buffer = true }) -vim.keymap.set({ 'n', 'v' }, 'k', 'gk', { buffer = true }) diff --git a/.vim/after/queries.bak/markdown/highlights.scm b/.vim/after/queries.bak/markdown/highlights.scm deleted file mode 100644 index 9aba385..0000000 --- a/.vim/after/queries.bak/markdown/highlights.scm +++ /dev/null @@ -1,100 +0,0 @@ -;; inherits: markdown -;; extends - -;From MDeiml/tree-sitter-markdown & Helix - -(list_item (task_list_marker_checked)) @comment (#set! "priority" 90) - -[ - (list_marker_plus) - (list_marker_minus) - (list_marker_star) - (list_marker_dot) - (list_marker_parenthesis) - (thematic_break) -] @string - -[ - (task_list_marker_checked) - (task_list_marker_unchecked) -] @task_marker - -[ - (atx_h1_marker) - (atx_h2_marker) - (atx_h3_marker) - (atx_h4_marker) - (atx_h5_marker) - (atx_h6_marker) -] @header_marker - -(atx_heading) @header_content - -; concealing -((atx_h1_marker) @header_marker.h1 - (#offset! @header_marker.h1 0 0 0 0) - ;(#set! conceal " ") -) - -((atx_h2_marker) @header_marker.h2 - (#offset! @header_marker.h2 0 0 0 0) - ;(#set! conceal " ") -) - -((atx_h3_marker) @header_marker.h3 - (#offset! @header_marker.h3 0 0 0 0) - ;(#set! conceal " ") -) - -((atx_h4_marker) @header_marker.h4 - (#offset! @header_marker.h4 0 0 0 0) - ;(#set! conceal " ") -) - -((atx_h5_marker) @header_marker.h5 - (#offset! @header_marker.h5 0 0 0 0) - ;(#set! conceal " ") -) - -((atx_h6_marker) @header_marker.h6 - (#offset! @header_marker.h6 0 0 0 0) - ;(#set! conceal " ") -) - -; used for first level list items -((list_marker_star) @list_marker.star - (#offset! @list_marker.star 0 0 0 -1) - ;(#set! conceal " ") -) -; used for second level list items -((list_marker_minus) @list_marker.minus - (#offset! @list_marker.minus 0 0 0 -1) - ;(#set! conceal " ") -) - -((list_marker_plus) @list_marker.plus - (#offset! @list_marker.plus 0 0 0 -1) - ;(#set! conceal " ") -) -((list_marker_dot) @list_marker.dot - (#offset! @list_marker.dot 0 0 0 -1) - ;(#set! conceal " ") -) -((list_marker_parenthesis) @list_marker.parenthesis - (#offset! @list_marker.parenthesis 0 0 0 -1) - ;(#set! conceal " ") -) - -;; replace '[x]' with -((task_list_marker_checked) @text.todo.checked - (#offset! @text.todo.checked 0 -2 0 0) - (#set! conceal "☑ ") -) - -;; replace '[ ]' with -((task_list_marker_unchecked) @text.todo.unchecked - (#offset! @text.todo.unchecked 0 -2 0 0) - (#set! conceal "☐ ") -) - -([(minus_metadata)] @comment) diff --git a/.vim/after/queries.bak/markdown_inline/highlights.scm b/.vim/after/queries.bak/markdown_inline/highlights.scm deleted file mode 100644 index ab0a7f4..0000000 --- a/.vim/after/queries.bak/markdown_inline/highlights.scm +++ /dev/null @@ -1,11 +0,0 @@ -;; inherits: markdown_inline -;; extends - -([ - (code_span_delimiter) - (shortcut_link) -] @comment) - -([ - (link_text) -] @string) diff --git a/.vim/init.lua b/.vim/init.lua deleted file mode 100644 index e2682cd..0000000 --- a/.vim/init.lua +++ /dev/null @@ -1,48 +0,0 @@ -local g = vim.g -g.mapleader = ' ' -- <leader> key to <space> -g.maplocalleader = '\\' - --- disable distribution plugins -vim.g.loaded_gzip = 1 -vim.g.loaded_tar = 1 -vim.g.loaded_tarPlugin = 1 -vim.g.loaded_zip = 1 -vim.g.loaded_zipPlugin = 1 -vim.g.loaded_getscript = 1 -vim.g.loaded_getscriptPlugin = 1 -vim.g.loaded_vimball = 1 -vim.g.loaded_vimballPlugin = 1 -vim.g.loaded_matchit = 1 -vim.g.loaded_2html_plugin = 1 -vim.g.loaded_logiPat = 1 -vim.g.loaded_rrhelper = 1 -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 -vim.g.loaded_netrwSettings = 1 -vim.g.loaded_netrwFileHandlers = 1 - --- prevent bluescreen --- https://github.com/neovim/neovim/issues/29505 --- https://github.com/folke/lazy.nvim/issues/1438 -vim.cmd('highlight Normal guibg=NONE guifg=NONE ctermbg=NONE ctermfg=NONE') -vim.opt.termguicolors = true - --- install lazy -local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' -if not vim.uv.fs_stat(lazypath) then - vim.fn.system({ - 'git', - 'clone', - '--filter=blob:none', - 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require('lazy').setup({ import = 'internal/plugins' }, { - change_detection = { notify = false }, - defaults = { lazy = true }, - dev = { path = '~/src' }, -}) diff --git a/.vim/lazy-lock.json b/.vim/lazy-lock.json deleted file mode 100644 index 9c0b3bd..0000000 --- a/.vim/lazy-lock.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "acme.nvim": { "branch": "main", "commit": "fb22d6ebc8c05d8958b757743982b32d23c607f4" }, - "aerial.nvim": { "branch": "master", "commit": "44684bf429dc40e97a6d00ffa09043ac3f692186" }, - "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, - "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, - "decisive.nvim": { "branch": "main", "commit": "ead9188df6411a52d8859552b8332cb864d22171" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "fzf-lua": { "branch": "main", "commit": "addb648ffe152c353232e8a88ff1364cbcf1ed1b" }, - "gentoo-syntax": { "branch": "master", "commit": "929bbebb5430f9d23032b138a57252d21b7db243" }, - "git-dev.nvim": { "branch": "master", "commit": "f8894349d04b2d922f2d170c5d66db729236d86f" }, - "gitgraph.nvim": { "branch": "main", "commit": "01e466b32c346a165135dd47d42f1244eca06572" }, - "gitlinker.nvim": { "branch": "master", "commit": "23982c86f50a9c3f4bc531d41b7a4a68ddd12355" }, - "gitsigns.nvim": { "branch": "main", "commit": "fcfa7a989cd6fed10abf02d9880dc76d7a38167d" }, - "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, - "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, - "lackluster.nvim": { "branch": "main", "commit": "d2519d14b2b6e9eef05752d5d4486ed5c48d6178" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "markdown.nvim": { "branch": "master", "commit": "dfa0d2def6dbf77e9206b16dc90cad4dd23d55d2" }, - "mediawiki.vim": { "branch": "master", "commit": "26e5737264354be41cb11d16d48132779795e168" }, - "mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" }, - "mini.align": { "branch": "main", "commit": "2b42ac0be7d570c2208f9e334ecef13453cd222d" }, - "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "mini.operators": { "branch": "main", "commit": "c6d87731f1a2c849888754347ffc5a1395bf2977" }, - "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, - "none-ls.nvim": { "branch": "main", "commit": "1280b7965b6ed17787ffab1d4e3d9795ecdd0f51" }, - "nvim-cmp": { "branch": "main", "commit": "ca0d80189fe4a2166b6b68c0e8abe231a75eff6b" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" }, - "nvim-lspconfig": { "branch": "master", "commit": "3a7387a9c980304059b2bd7075684d6ef98ff331" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, - "nvim-treesitter-refactor": { "branch": "master", "commit": "d8b74fa87afc6a1e97b18da23e762efb032dc270" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "205e3369bc83d8cb83f7409c36120e24611f8c5c" }, - "oil.nvim": { "branch": "master", "commit": "302bbaceeafc690e6419e0c8296e804d60cb9446" }, - "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "render-markdown": { "branch": "main", "commit": "a2c2493c21cf61e5554ee8bc83da75bd695921da" }, - "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, - "timerly": { "branch": "main", "commit": "17299a4d332c483ce09052fe8478b41b992f2594" }, - "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "220cba7596cc2ff95c251d3173b26eaf9924ec10" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" }, - "volt": { "branch": "main", "commit": "c45d5f48da8e802e608b5c6da471ca4d84276dfb" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, - "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }, - "zk-nvim": { "branch": "main", "commit": "d0bac443233635d18968affde4701db2cf2435b5" } -} diff --git a/.vim/lua/internal/colors.lua b/.vim/lua/internal/colors.lua deleted file mode 100644 index a03501f..0000000 --- a/.vim/lua/internal/colors.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - base00 = '#080808', - base01 = '#db4d6d', - base02 = '#5dac81', - base03 = '#fad689', - base04 = '#58b2dc', - base05 = '#70649a', - base06 = '#69b0ac', - base07 = '#bdc0ba', - base08 = '#4f4f48', - base09 = '#cb1b45', - base0A = '#86c166', - base0B = '#f7d94c', - base0C = '#2ea9df', - base0D = '#8a6bbe', - base0E = '#81c7d4', - base0F = '#fffffb', -} \ No newline at end of file diff --git a/.vim/lua/internal/plugins/aerial.lua b/.vim/lua/internal/plugins/aerial.lua deleted file mode 100644 index 0094e17..0000000 --- a/.vim/lua/internal/plugins/aerial.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - 'stevearc/aerial.nvim', - dependencies = { - 'nvim-treesitter/nvim-treesitter', - 'echasnovski/mini.icons', - }, - opts = {}, - keys = { - { '<leader>b', '<cmd>AerialToggle<cr>' }, - { '<c-,>', '<cmd>AerialToggle<cr>' }, - }, - }, -} diff --git a/.vim/lua/internal/plugins/cmp.lua b/.vim/lua/internal/plugins/cmp.lua deleted file mode 100644 index 086e1ac..0000000 --- a/.vim/lua/internal/plugins/cmp.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - { - enabled = false, - -- 'hrsh7th/nvim-cmp', - 'iguanacucumber/magazine.nvim', -- perf improvements - name = 'nvim-cmp', - lazy = false, - -- event = {'InsertEnter', 'CmdlineEnter' }, - priority = 100, - dependencies = { - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-nvim-lsp', - 'https://codeberg.org/FelipeLema/cmp-async-path', - -- 'hrsh7th/cmp-nvim-lua', - 'hrsh7th/cmp-nvim-lsp-signature-help', -- used to provide function signature completion - 'hrsh7th/cmp-cmdline', - 'dmitmel/cmp-cmdline-history', - 'hrsh7th/cmp-nvim-lsp-document-symbol', -- used by cmdline completion - -- 'f3fora/cmp-spell', - - { 'L3MON4D3/LuaSnip', run = 'make install_jsregexp' }, - 'saadparwaiz1/cmp_luasnip', - - 'onsails/lspkind.nvim', - }, - config = function() - require('internal.snippets') - require('internal.completion') - end, - }, -} diff --git a/.vim/lua/internal/plugins/colorschemes.lua b/.vim/lua/internal/plugins/colorschemes.lua deleted file mode 100644 index e533ebb..0000000 --- a/.vim/lua/internal/plugins/colorschemes.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - { - enabled = false, - 'olivercederborg/poimandres.nvim', - lazy = false, - config = function() - require('poimandres').setup({ - disable_background = true, - -- dim_nc_background = true, - }) - end, - -- optionally set the colorscheme within lazy config - -- init = function() - -- vim.cmd('colorscheme poimandres') - -- end, - }, - { - enabled = true, - 'https://github.com/slugbyte/lackluster.nvim', - lazy = true, - config = function() - local lackluster = require('lackluster') - lackluster.setup({ - tweak_color = { - lack = '#70649a', - -- luster = '#ff0000', - }, - tweak_syntax = { - comment = lackluster.color.gray6, - }, - tweak_background = { - normal = 'none', - }, - tweak_highlight = { - ['@markup.heading'] = { - fg = '#ffffff', - }, - ['@comment'] = { - italic = true, - }, - }, - tweak_ui = { - enable_end_of_buffer = true, - }, - }) - end, - init = function() - vim.g.darkmode_colorscheme_dark = 'lackluster' - end, - }, - { - enabled = true, - 'https://github.com/elaijuh/acme.nvim', - lazy = true, - init = function() - vim.g.darkmode_colorscheme_light = 'acme' - end, - }, -} diff --git a/.vim/lua/internal/plugins/csv.lua b/.vim/lua/internal/plugins/csv.lua deleted file mode 100644 index bc4cb2c..0000000 --- a/.vim/lua/internal/plugins/csv.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - 'emmanueltouzery/decisive.nvim', - lazy = true, - ft = { 'csv' }, - main = 'decisive', - keys = { - { - '<leader>a', - function() - require('decisive').align_csv({}) - require('decisive').show_sticky_header() - end, - desc = 'decisive: Align CSV', - }, - { '[,', ":lua require('decisive').align_csv_prev_col()<cr>", desc = 'decisive: Prev column' }, - { '],', ":lua require('decisive').align_csv_next_col()<cr>", desc = 'decisive: Next column' }, - }, - }, -} diff --git a/.vim/lua/internal/plugins/gentoo.lua b/.vim/lua/internal/plugins/gentoo.lua deleted file mode 100644 index 2fc8684..0000000 --- a/.vim/lua/internal/plugins/gentoo.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - 'gentoo/gentoo-syntax', - ft = { 'ebuild' }, - init = function() - vim.api.nvim_create_autocmd('LspAttach', { - callback = function(args) - if vim.opt.filetype == 'ebuild' then - vim.lsp.stop_client(vim.lsp.get_clients({ bufnr = args.bufnr })) - end - end, - }) - end, - }, -} diff --git a/.vim/lua/internal/plugins/lsp.lua b/.vim/lua/internal/plugins/lsp.lua deleted file mode 100644 index 7175a89..0000000 --- a/.vim/lua/internal/plugins/lsp.lua +++ /dev/null @@ -1,290 +0,0 @@ -return { - { - 'neovim/nvim-lspconfig', - lazy = false, - dependencies = { - { 'j-hui/fidget.nvim', opts = {} }, - 'stevearc/conform.nvim', - }, - config = function() - local capabilities = nil - if pcall(require, 'blink.cmp') then - capabilities = require('blink.cmp').get_lsp_capabilities() - elseif pcall(require, 'cmp_nvim_lsp') then - capabilities = require('cmp_nvim_lsp').default_capabilities() - end - - local lspconfig = require('lspconfig') - - local servers = { - clangd = { - cmd = { - 'clangd', - '--clang-tidy', - '--header-insertion=iwyu', - '--import-insertions', - '--header-insertion-decorators', - }, - }, - elixirls = { - cmd = { 'elixir-ls' }, - settings = { - elixirLS = { - dialyzerEnabled = false, - }, - }, - }, - gopls = { - settings = { - gopls = { - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - analyses = { - -- composites = false, - nilness = true, - shadow = false, - unusedparams = true, - unusedwrite = true, - }, - gofumpt = true, - -- hoverKind = 'Structured', - }, - }, - }, - lua_ls = { - cmd = { 'luals' }, -- custom firejail-wrapped - -- cmd = { 'lua-language-server' }, - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - path = vim.split(package.path, ';'), - }, - diagnostics = { - globals = { - '_G', - 'assert', - 'error', - 'os', - 'package', - 'pairs', - 'ipairs', - 'pcall', - 'require', - 'string', - 'table', - 'type', - 'unpack', - 'vim', - 'xpcall', - }, - neededFileStatus = { - ['code-style-check'] = 'Any', - }, - }, - format = { - enable = true, - defaultConfig = { - indent_style = 'space', - indent_size = '2', - }, - }, - workspace = { - library = { - [vim.env.VIMRUNTIME .. '/lua'] = true, - [vim.env.VIMRUNTIME .. '/lua/vim/lsp'] = true, - [vim.fn.stdpath('config') .. '/lua'] = true, - }, - }, - telemetry = { - enable = false, - }, - }, - }, - }, - rust_analyzer = { - settings = { - ['rust-analyzer'] = { - diagnostics = { - enable = true, - }, - checkOnSave = { - command = { 'cargo', 'clippy' }, - }, - }, - }, - }, - ts_ls = { - init_options = { - tsserver = { - path = '/usr/lib/node_modules/typescript/lib', - }, - }, - }, - pylsp = {}, - zls = { - cmd = { - 'zls', - '--log-level', - 'warn', - }, - }, - bashls = {}, - cssls = {}, - jsonls = {}, - html = {}, - superhtml = {}, - kotlin_language_server = { - -- cmd = vim.lsp.rpc.connect('127.0.0.1', 20100), - cmd = { - 'distrobox', - 'enter', - '-n', - 'android-dev', - '--', - '/usr/local/kotlin-langserver/bin/kotlin-language-server', - }, - init_options = { - formatting = { - formatter = 'none', -- disable because we use ktlint via gradle - }, - }, - }, - } - - for name, opts in pairs(servers) do - opts = vim.tbl_deep_extend('force', { - capabilities = capabilities, - }, opts) - lspconfig[name].setup(opts) - end - - vim.api.nvim_create_autocmd('LspAttach', { - callback = function() - -- local client = - -- assert(vim.lsp.get_client_by_id(args.data.client_id), 'must have valid client') - - vim.opt_local.omnifunc = 'v:lua.vim.lsp.omnifunc' - - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { buffer = true }) - vim.keymap.set('n', 'gR', vim.lsp.buf.references, { buffer = true }) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { buffer = true }) - vim.keymap.set('n', 'gT', vim.lsp.buf.type_definition, { buffer = true }) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = true }) - vim.keymap.set('n', 'grr', vim.lsp.buf.rename, { buffer = true }) - vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, { buffer = true }) - end, - }) - end, - }, - - { - 'folke/lazydev.nvim', - ft = 'lua', - -- could add a completion source to cmp? - }, - - -- formatting - { - 'stevearc/conform.nvim', - lazy = false, - opts = { - formatters_by_ft = { - lua = { 'stylua' }, - go = { 'goimports', 'gofmt' }, - python = { 'ruff_format' }, - }, - }, - config = function(_, opts) - require('conform').setup(opts) - - vim.api.nvim_create_autocmd('BufWritePre', { - callback = function(args) - if vim.g.nofmt then - return - end - require('conform').format({ - bufnr = args.buf, - lsp_fallback = true, - quiet = true, - }) - end, - }) - end, - }, - - -- linting - { - 'nvimtools/none-ls.nvim', - dependencies = { 'nvim-lua/plenary.nvim' }, - event = 'VeryLazy', - config = function() - local nls = require('null-ls') - nls.setup({ - sources = { - -- https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTINS.md - -- nls.builtins.code_actions.gitsigns, - nls.builtins.code_actions.impl, - - -- nls.builtins.completion.spell, - - -- nls.builtins.diagnostics.checkmake, - -- nls.builtins.diagnostics.cmake_lint, - -- nls.builtins.diagnostics.cppcheck, - -- nls.builtins.diagnostics.gccdiag, - nls.builtins.diagnostics.golangci_lint, - -- nls.builtins.diagnostics.hadolint, - -- nls.builtins.diagnostics.pylint, - -- nls.builtins.diagnostics.selene, - -- nls.builtins.diagnostics.semgrep, - nls.builtins.diagnostics.sqlfluff, - -- nls.builtins.diagnostics.stylelint, - -- nls.builtins.diagnostics.textidote, - nls.builtins.diagnostics.vale, - }, - }) - end, - }, - - -- diagnostics - { - enabled = true, - 'rachartier/tiny-inline-diagnostic.nvim', - lazy = false, - opts = { - preset = 'nonerdfont', - signs = { - left = '', - right = '', - diag = '', - arrow = '◂ ', - up_arrow = '▴ ', - }, - options = { - throttle = 0, - show_source = { - enabled = true, - }, - multilines = { - enabled = false, - always_show = false, - }, - -- break_line = { enabled = true }, - show_all_diags_on_cursorline = true, - }, - }, - config = function(_, opts) - require('tiny-inline-diagnostic').setup(opts) - if vim.o.background == 'light' then - require('tiny-inline-diagnostic').change({}, { mixing_color = '#aaaaaa' }) - end - end, - }, -} diff --git a/.vim/lua/internal/plugins/markdown.lua b/.vim/lua/internal/plugins/markdown.lua deleted file mode 120000 index 5b578d5..0000000 --- a/.vim/lua/internal/plugins/markdown.lua +++ /dev/null @@ -1 +0,0 @@ -writing.lua \ No newline at end of file diff --git a/.vim/lua/internal/plugins/mediawiki.lua b/.vim/lua/internal/plugins/mediawiki.lua deleted file mode 100644 index f557627..0000000 --- a/.vim/lua/internal/plugins/mediawiki.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - 'chikamichi/mediawiki.vim', - ft = { 'mediawiki' }, - }, -} diff --git a/.vim/lua/internal/plugins/telescope.lua b/.vim/lua/internal/plugins/telescope.lua deleted file mode 100644 index 2e9341b..0000000 --- a/.vim/lua/internal/plugins/telescope.lua +++ /dev/null @@ -1,137 +0,0 @@ -return { - { - enabled = false, - 'nvim-telescope/telescope.nvim', - lazy = false, - dependencies = { - { 'nvim-lua/plenary.nvim' }, - { - 'nvim-telescope/telescope-fzf-native.nvim', - build = 'cmake -S. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release', - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - { - 'prochri/telescope-all-recent.nvim', - lazy = false, - dependencies = { - 'nvim-telescope/telescope.nvim', - 'kkharji/sqlite.lua', - }, - after = { 'nvim-telescope/telescope-ui-select.nvim' }, - opts = {}, - }, - }, - config = function(spec, _) - require('telescope').setup({ - defaults = require('telescope.themes').get_ivy({ - prompt = false, - borderchars = { - preview = { '─', '│', '─', '│', '┌', '┐', '┘', '└' }, - }, - }), - - extensions = { - wrap_results = true, - - fzf = {}, - - ['ui-select'] = { - require('telescope.themes').get_ivy({ - prompt = false, - -- sharp edges please - borderchars = { - preview = { '─', '│', '─', '│', '┌', '┐', '┘', '└' }, - }, - layout_config = { height = 9 }, - }), - }, - }, - }) - - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - -- user commands - vim.api.nvim_create_user_command( - 'F', - 'Telescope find_files search_dirs=<args>', - { desc = 'Telescope find_files', nargs = '?' } - ) - vim.api.nvim_create_user_command( - 'G', - 'Telescope live_grep search_dirs=<args>', - { desc = 'Telescope live_grep', nargs = '?' } - ) - - -- keymaps - local builtin = require('telescope.builtin') - for _, o in ipairs(spec.keys) do - if not o[2] then - local mod = vim.split(o.desc, ': ')[2] - vim.keymap.set(o.mode, o[1], builtin[mod], { desc = o.desc }) - end - end - - -- highlights - vim.schedule(function() - vim.api.nvim_set_hl(0, 'TelescopeBorder', { fg = 'NvimDarkGrey4', force = true }) - vim.api.nvim_set_hl(0, 'TelescopeTitle', { fg = 'NvimLightMagenta', force = true }) - vim.api.nvim_set_hl(0, 'NormalFloat', { link = 'TelescopeNormal', force = true }) - end) - end, - keys = { - { mode = 'n', ';/', desc = 'telescope: current_buffer_fuzzy_find' }, - { mode = 'n', ';b', desc = 'telescope: buffers' }, - { mode = 'n', ';f', desc = 'telescope: find_files' }, - { mode = 'n', ';g', desc = 'telescope: live_grep' }, - { mode = 'n', ';d', desc = 'telescope: diagnostics' }, - { - mode = 'n', - ';v', - function() - require('telescope.builtin').find_files({ - prompt_title = 'vimrc', - search_dirs = { - vim.fn.stdpath('config'), - }, - }) - end, - desc = 'telescope: vim_config', - }, - { - mode = 'n', - ';;t', - '<cmd>Telescope<cr>', - desc = 'telescope: select (interactive)', - }, - { - mode = 'n', - ';;f', - function() - local dir - if vim.opt.filetype:get() == 'oil' then - dir = require('oil').get_current_dir() - else - dir = vim.fn.expand('%:p') - end - _G.feedkeys(':Telescope find_files search_dirs=' .. dir) - end, - desc = 'telescope: find_files (interactive)', - }, - { - mode = 'n', - ';;g', - function() - local dir - if vim.opt.filetype:get() == 'oil' then - dir = require('oil').get_current_dir() - else - dir = vim.fn.expand('%:p') - end - _G.feedkeys(':Telescope live_grep search_dirs=' .. dir) - end, - desc = 'telescope: live_grep (interactive)', - }, - }, - }, -} diff --git a/.vim/lua/internal/plugins/todo.lua b/.vim/lua/internal/plugins/todo.lua deleted file mode 100644 index d99458e..0000000 --- a/.vim/lua/internal/plugins/todo.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - { - 'folke/todo-comments.nvim', - dependencies = { 'nvim-lua/plenary.nvim' }, - lazy = false, - cmd = { 'TodoTelescope' }, - opts = { - merge_keywords = true, - keywords = { - FIX = { icon = '' }, - TODO = { icon = '' }, - HACK = { icon = '' }, - WARN = { icon = '' }, - PERF = { icon = '' }, - NOTE = { icon = '' }, - TEST = { icon = '' }, - }, - highlight = { - keyword = 'bg', - -- pattern = [[<(KEYWORDS)(|\(.+\))(:|)]], - pattern = [[<(KEYWORDS)(|\(.+\)):]], - }, - search = { - -- pattern = [[\b(KEYWORDS)(|\(.+\))(:|)]], - pattern = [[\b(KEYWORDS)(|\(.+\)):]], - }, - }, - keys = { - { mode = 'n', ';t', '<cmd>TodoFzfLua<cr>', desc = 'todo: list todos' }, - { - mode = 'n', - ']t', - function() - require('todo-comments').jump_next() - end, - desc = 'todo: next', - }, - { - mode = 'n', - '[t', - function() - require('todo-comments').jump_prev() - end, - desc = 'todo: prev', - }, - }, - }, -} diff --git a/.vim/lua/internal/plugins/writing.lua b/.vim/lua/internal/plugins/writing.lua deleted file mode 100644 index 8f207b7..0000000 --- a/.vim/lua/internal/plugins/writing.lua +++ /dev/null @@ -1,117 +0,0 @@ -return { - { - -- DESC: handy markdown commands - 'tadmccorkle/markdown.nvim', - ft = { 'markdown' }, - opts = { - mappings = false, - on_attach = function(buf) - vim.keymap.set('n', 'nl', '<cmd>MDListItemBelow<cr>', { buffer = buf }) - vim.keymap.set('n', 'nl', '<cmd>MDListItemAbove<cr>', { buffer = buf }) - vim.keymap.set('n', '<m-x>', '<cmd>MDTaskToggle<cr>', { buffer = buf }) - vim.keymap.set('x', '<m-x>', '<cmd>MDTaskToggle<cr>', { buffer = buf }) - vim.keymap.set('x', '<m-l>', '<esc>gv<plug>(markdown_add_link_visual)', { buffer = buf }) - end, - }, - }, - { - -- DESC: pretty print markdown - 'MeanderingProgrammer/markdown.nvim', - name = 'render-markdown', -- needed if used together with markdown.nvim above - main = 'render-markdown', - dependencies = { - 'nvim-treesitter/nvim-treesitter', - 'echasnovski/mini.icons', - }, - ft = { 'markdown' }, - opts = { - completions = { blink = { enabled = true } }, - sign = { enabled = false }, - heading = { - width = 'block', - -- icons = { '❶ ', '❷ ', '❸ ', '❹ ', '❺ ', '❻ ' }, - icons = { - '▒ ', - '▒▒ ', - '▒▒▒ ', - '▒▒▒▒ ', - '▒▒▒▒▒ ', - '▒▒▒▒▒▒ ', - }, - signs = { 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ' }, - }, - bullet = { - icons = { '∙', '∘', '⋅', '⋄' }, - }, - checkbox = { - checked = { icon = ' ' }, - unchecked = { icon = ' ' }, - custom = { - todo = { raw = '[-]', rendered = ' ', highlight = 'RenderMarkdownTodo' }, - }, - }, - }, - init = vim.schedule_wrap(function() - vim.api.nvim_set_hl(0, 'RenderMarkdownH1Bg', { bg = 'NvimDarkCyan' }) - vim.api.nvim_set_hl(0, 'RenderMarkdownH1Fg', { fg = 'NvimLightCyan' }) - - vim.api.nvim_set_hl(0, 'RenderMarkdownH2Bg', { bg = 'NvimDarkMagenta' }) - vim.api.nvim_set_hl(0, 'RenderMarkdownH2Fg', { fg = 'NvimLightMagenta' }) - - vim.api.nvim_set_hl(0, 'RenderMarkdownH3Bg', { bg = 'NvimDarkYellow' }) - vim.api.nvim_set_hl(0, 'RenderMarkdownH3Fg', { fg = 'NvimLightYellow' }) - - vim.api.nvim_set_hl(0, 'RenderMarkdownH4Bg', { bg = 'NvimDarkBlue' }) - vim.api.nvim_set_hl(0, 'RenderMarkdownH4Fg', { fg = 'NvimLightBlue' }) - - vim.api.nvim_set_hl(0, 'RenderMarkdownH6Bg', { bg = 'NvimDarkRed' }) - vim.api.nvim_set_hl(0, 'RenderMarkdownH6Fg', { fg = 'NvimLightRed' }) - - vim.api.nvim_set_hl(0, '@markup.bold', { link = 'markdownBold' }) - vim.api.nvim_set_hl(0, '@markup.italic', { link = 'markdownItalic' }) - end), - }, - { - 'folke/zen-mode.nvim', - cmd = { 'ZenMode' }, - opts = { - window = { - height = 1, - options = { - number = false, - cursorline = false, - }, - }, - plugins = { - options = { - ruler = false, - showcmd = false, - laststatus = 0, - }, - gitsigns = { enabled = false }, - twilight = { enabled = true }, - }, - on_open = function() - vim.diagnostic.enable(false) - require('render-markdown').buf_disable() - end, - on_close = function() - vim.diagnostic.enable(true) - require('render-markdown').buf_enable() - end, - }, - dependencies = { - { - 'folke/twilight.nvim', - cmd = { 'Twilight' }, - opts = { - context = 24, - dimming = { - alpha = 0.3, - color = { 'Normal', '#ffffff' }, - }, - }, - }, - }, - }, -} diff --git a/.vim/lua/internal/plugins/zk.lua b/.vim/lua/internal/plugins/zk.lua deleted file mode 100644 index da108b0..0000000 --- a/.vim/lua/internal/plugins/zk.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - { - lazy = false, - 'zk-org/zk-nvim', - main = 'zk', - opts = { - picker = 'select', - }, - keys = { - -- these will work everywhere - { ';zc', ':ZkNew ', desc = 'zk: new note' }, - { ';zz', '<cmd>ZkNotes {sort={"modified"}}<cr>', desc = 'zk: list notes' }, - { ';zl', '<cmd>ZkLinks<cr>', desc = 'zk: list links' }, - { ';zb', '<cmd>ZkBacklinks<cr>', desc = 'zk: list backlinks' }, - { ';zt', '<cmd>ZkTags<cr>', desc = 'zk: list tags' }, - -- { ';zj', '<cmd>ZkNotes { dir = "500_journals" }<cr>' }, - }, - init = function() - require('internal.zk') - end, - }, -} diff --git a/.vim/lua/internal/zk.lua b/.vim/lua/internal/zk.lua deleted file mode 100644 index 4631e13..0000000 --- a/.vim/lua/internal/zk.lua +++ /dev/null @@ -1,73 +0,0 @@ -if not vim.env.ZK_NOTEBOOK_DIR then - vim.notify('Missing ZK_NOTEBOOK_DIR!', vim.log.levels.WARN) - return -end - -local api = require('zk.api') -local util = require('zk.util') - -local function insert_new_note() - -- TODO: catch error an delete note - api.new(nil, nil, function(err1, res1) - if not res1 then - error(err1) - end - - -- update index to include the new note - api.index(nil, nil, nil) - - local path = res1.path - local filename = vim.fs.basename(path) - local location = util.get_lsp_location_from_caret() - - api.link(filename, location, nil, {}, function(err2, res2) - if not res2 then - error(err2) - end - - -- open split - local buf = vim.api.nvim_create_buf(true, false) - vim.api.nvim_buf_set_name(buf, filename) - vim.api.nvim_buf_call(buf, function() - vim.cmd.edit(path) - end) - local win = vim.api.nvim_open_win(buf, false, { - split = 'below', - win = 0, - }) - -- move to split - vim.api.nvim_set_current_win(win) - vim.api.nvim_win_set_cursor(win, { -1, 0 }) - end) - end) -end - -local function on_attach() - if not vim.env.ZK_NOTEBOOK_DIR then - vim.notify('Missing ZK_NOTEBOOK_DIR!', vim.log.levels.WARN) - return - end - - -- enable virtual_text diagnostics to show link titles - vim.diagnostic.config({ virtual_text = true }) - - local opts = { remap = true, silent = false, buffer = true } - - -- -- list zettelkasten - -- vim.keymap.set('n', '-', ':call feedkeys(";zz")<cr>', opts) - - -- follow links - -- TODO: should this also work on outgoing links? - vim.keymap.set('n', '<cr>', '<cmd>lua vim.lsp.buf.definition()<cr>', opts) - - -- insert ref to new note and open note in split - vim.keymap.set({ 'n', 'i' }, ';zi', insert_new_note, opts) -end - --- setup binds to run when entering zettel buffers -vim.api.nvim_create_autocmd({ 'BufEnter' }, { - pattern = vim.env.ZK_NOTEBOOK_DIR .. '/*.md', - callback = on_attach, - group = vim.api.nvim_create_augroup('zk-on-attach', { clear = true }), - once = true, -}) diff --git a/.vim/plugin/_globals.lua b/.vim/plugin/_globals.lua deleted file mode 100644 index 5bf99a4..0000000 --- a/.vim/plugin/_globals.lua +++ /dev/null @@ -1,3 +0,0 @@ -_G.feedkeys = function(keys) - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(keys, true, false, true), 'n', true) -end diff --git a/.vim/plugin/auto.lua b/.vim/plugin/auto.lua deleted file mode 100644 index 98f0ef1..0000000 --- a/.vim/plugin/auto.lua +++ /dev/null @@ -1,38 +0,0 @@ -local augroup = vim.api.nvim_create_augroup -local autocmd = vim.api.nvim_create_autocmd - -do - local group = augroup('EasyQuit', { clear = true }) - autocmd('FileType', { - pattern = { - 'help', - 'qf', - 'dap-float', - 'gitsigns-blame', - 'git', - }, - callback = function() - vim.keymap.set('n', 'q', '<cmd>close<cr>', { silent = true, buffer = 0 }) - end, - group = group, - }) - autocmd('FileType', { - pattern = { 'gitgraph' }, - callback = function() - vim.keymap.set('n', 'q', '<cmd>bdel!<cr>', { silent = true, buffer = 0 }) - end, - group = group, - }) - autocmd('FileType', { - pattern = { 'DiffviewFiles' }, - callback = function() - vim.keymap.set('n', 'q', '<cmd>tabclose<cr>', { silent = true, buffer = 0 }) - end, - group = group, - }) - -- autocmd('TermClose', { - -- pattern = { 'term://*' }, - -- command = [[ if !v:event.status | exe 'bdelete! '..expand('<abuf>') | endif ]], - -- group = group, - -- }) -end diff --git a/.vim/plugin/darkmode.lua b/.vim/plugin/darkmode.lua deleted file mode 100644 index 6ffd06f..0000000 --- a/.vim/plugin/darkmode.lua +++ /dev/null @@ -1,47 +0,0 @@ --- this plugin registers registers and autocommand that switches colorschemes on UIEnter based on --- the system's preference for dark/light mode - -local state = { enabled = true } - -if not state.enabled then - return -end - -local set_darkmode = function(enabled) - if enabled then - vim.opt.background = 'dark' - vim.cmd.colorscheme(vim.g.darkmode_colorscheme_dark or 'default') - else - vim.opt.background = 'light' - vim.cmd.colorscheme(vim.g.darkmode_colorscheme_light or 'default') - end -end - --- returns if system is configured to use darkmode -local discover = function() - require('plenary.job') - :new({ - command = 'porta', - args = { 'settings', 'org.freedesktop.appearance', 'color-scheme' }, - enable_recording = true, - on_exit = vim.schedule_wrap(function(job, exitcode) - local darkmode_enabled = true - local res = job:result() - if exitcode == 0 and #res then - darkmode_enabled = not (res[1] == 'prefer-light') - end - set_darkmode(darkmode_enabled) - end), - }) - :start() -end - --- setup autogroup -local aug = vim.api.nvim_create_augroup('darkmode', { clear = true }) - --- setup color-scheme detection via desktop portal apis -vim.api.nvim_create_autocmd({ 'UIEnter', 'VimResume' }, { callback = discover, group = aug }) -vim.api.nvim_create_autocmd({ 'Signal' }, { pattern = 'SIGUSR1', callback = discover, group = aug }) - --- fix ColorColumn not being defined -vim.api.nvim_set_hl(0, 'ColorColumn', { link = 'CursorColumn', force = true }) diff --git a/.vim/plugin/hardmode.lua b/.vim/plugin/hardmode.lua deleted file mode 100644 index f18a5ef..0000000 --- a/.vim/plugin/hardmode.lua +++ /dev/null @@ -1,10 +0,0 @@ --- hard mode means we're not using the arrow keys! - -local bail = function() - vim.cmd([[silent! echohl ErrorMsg | echo "HARD MODE: hjkl operation only" | echohl None]]) -end - -vim.keymap.set({ 'v', 'i' }, '<up>', bail) -vim.keymap.set({ 'v', 'i' }, '<down>', bail) -vim.keymap.set({ 'v', 'i' }, '<left>', bail) -vim.keymap.set({ 'v', 'i' }, '<right>', bail) diff --git a/.vim/plugin/keymaps.lua b/.vim/plugin/keymaps.lua deleted file mode 100644 index f7cdf20..0000000 --- a/.vim/plugin/keymaps.lua +++ /dev/null @@ -1,49 +0,0 @@ -local set = vim.keymap.set - -set('n', 'gb', '<cmd>bnext<cr>', { desc = 'Next buffer' }) -set('n', 'gB', '<cmd>bprevious<cr>', { desc = 'Prev buffer' }) -set( - 'n', - 'g<bs>', - '<cmd>lua vim.notify("Use <lt>C-o> and <lt>C-i>!", vim.log.levels.WARN)<cr>', - { desc = 'Last buffer' } -) - -set('n', ';yp', function() - local payload = (vim.fn.expand('%:p') .. ':' .. vim.fn.line('.')) - vim.fn.setreg('+', payload) - vim.notify(payload) -end, { desc = 'Yank current buffer path and line number' }) - -set('n', ';yP', function() - local payload = vim.fn.expand('%:p') - vim.fn.setreg('+', payload) - vim.notify(payload) -end, { desc = 'Yank current buffer path' }) - -set('n', ';yn', function() - local payload = vim.fs.basename(vim.fn.expand('%:p')) - vim.fn.setreg('+', payload) - vim.notify(payload) -end, { desc = 'Yank current buffer name' }) - -set('t', '<esc>', [[ <c-\><c-n> ]], { desc = 'Terminal: Exit INSERT mode' }) - -set('v', '<', '<gv', { desc = 'indent' }) -set('v', '>', '>gv', { desc = 'outdent' }) - -set('n', '<s-esc>', '<cmd>nohlsearch<cr>', { desc = 'Clear search highlights' }) --- set('n', '<tab>', '<cmd>normal! za<cr>', { desc = 'Toggle fold under cursor' }) -set('n', '<s-tab>', '<cmd>normal! zA<cr>', { desc = 'Toggle fold under cursor (recursive)' }) - -set('n', '<a-j>', '<cmd>cnext<cr>', { desc = 'Next in quickfix' }) -set('n', '<a-k>', '<cmd>cprev<cr>', { desc = 'Prev in quickfix' }) - -set('n', '<leader><bs>', '@:', { desc = 'Rerun last command' }) - -set( - 'n', - 'gx', - '<cmd>lua vim.ui.open(vim.fn.expand("<cfile>"))<cr>', - { desc = 'Open file under cursor' } -) diff --git a/.vim/plugin/syncbg.lua b/.vim/plugin/syncbg.lua deleted file mode 100644 index c11bef6..0000000 --- a/.vim/plugin/syncbg.lua +++ /dev/null @@ -1,73 +0,0 @@ --- this plugin registers two autocmds that trigger when openeing and closing the editor, setting the --- background of the terminal to the color used by our colorscheme using CSI control codes. - -local state = { enabled = false } - -if not state.enabled then - return -end - -local set_bg = function(clear) - if not (state.tty and state.normal) then - return - end - if clear then - -- emit CSI to unset custom background - os.execute('printf "\\033]111\\007" > ' .. state.tty) - else - -- emit CSI to change terminal background to Normal.bg - os.execute( - 'printf "\\033]11;' .. string.format('#%06x', state.normal.bg) .. '\\007" > ' .. state.tty - ) - -- set colorscheme Normal.bg to NONE, making it transparent - vim.cmd([[hi Normal ctermbg=NONE guibg=NONE]]) - end -end - -local discover = function() - if not state.tty then - -- get tty handle - local ok, tty_handle = pcall(io.popen, 'tty') - if (not ok) or tty_handle == nil then - return - end - local tty = tty_handle:read('*l') - tty_handle:close() - if tty:find('not a tty') then - return - end - state.tty = tty - end - - if not state.normal then - -- get colorscheme Normal highlight - local normal = vim.api.nvim_get_hl(0, { name = 'Normal', create = false }) - if normal.bg == nil then - return - end - -- cache old value for use with VimResume - state.normal = normal - end - - -- vim.notify('syncbg: ' .. vim.inspect(state), vim.log.levels.DEBUG) -end - --- setup autogroup -local aug = vim.api.nvim_create_augroup('syncbg', { clear = true }) - --- register update hook -vim.api.nvim_create_autocmd({ 'ColorScheme', 'UIEnter', 'VimResume' }, { - group = aug, - callback = vim.schedule_wrap(function() - discover() - set_bg(false) - end), -}) - --- register reset hook -vim.api.nvim_create_autocmd({ 'UILeave' }, { - group = aug, - callback = vim.schedule_wrap(function() - set_bg(true) - end), -}) diff --git a/.vim/plugin/termopen.lua b/.vim/plugin/termopen.lua deleted file mode 100644 index 951857f..0000000 --- a/.vim/plugin/termopen.lua +++ /dev/null @@ -1,72 +0,0 @@ -local function termopen(opts) - opts = opts or {} - - -- setup the buffer - local buf = vim.api.nvim_create_buf(false, true) - vim.api.nvim_set_option_value('bufhidden', 'wipe', { buf = buf }) - vim.api.nvim_set_option_value('modifiable', false, { buf = buf }) - - -- setup keymappings - vim.keymap.set('n', 'q', '<cmd>close<cr>', { buffer = buf }) - vim.keymap.set('n', '<esc>', '<cmd>close<cr>', { buffer = buf }) - - -- setup the window - local w = math.ceil(vim.o.columns * 1.0) - local h = math.ceil(vim.o.lines * 0.4) - local win = vim.api.nvim_open_win(buf, true, { - style = 'minimal', - relative = 'editor', - width = w, - height = h, - row = math.ceil(vim.o.lines - h), - col = vim.o.columns, - border = { ' ', '─', ' ', ' ', ' ', '─', ' ', ' ' }, - }) - vim.api.nvim_set_current_win(win) - - -- spawn the command - if #opts.cmd == 0 then - opts.cmd = { vim.env.SHELL } - end - vim.fn.termopen(opts.cmd, { - on_exit = function() - -- if vim.api.nvim_win_is_valid(win) then - -- vim.api.nvim_win_close(win, true) - -- end - end, - }) - - -- put into insert mode - vim.cmd.startinsert() -end - --- provide user commands -vim.api.nvim_create_user_command('Termopen', function(a) - termopen({ cmd = a.fargs }) -end, { nargs = '*' }) - --- alias -vim.api.nvim_create_user_command('T', function(a) - termopen({ cmd = a.fargs }) -end, { nargs = '*' }) - --- helper to spawn &makeprg -vim.api.nvim_create_user_command('Make', function(a) - if vim.opt_local.makeprg == nil then - vim.ui.input({ prompt = 'Enter makeprg: ' }, function(input) - vim.opt_local.makeprg = input - end) - end - - local cmd = vim.split(vim.opt_local.makeprg:get(), ' ') - cmd = vim.tbl_map(function(p) - p, _ = string.gsub(p, [[%$%*]], a.args) - p, _ = vim.fn.expand(p) - return p - end, cmd) - termopen({ cmd = cmd }) -end, { nargs = '*' }) - --- setup keymappings -vim.keymap.set('n', '<leader><leader>m', '<cmd>Make<cr>', { desc = 'Run :Make' }) -vim.keymap.set('n', '<leader><leader>t', '<cmd>Termopen<cr>', { desc = 'Run :Termopen' }) 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, - }, - }, - } - ), -} diff --git a/.vim/snippets/html.lua b/.vim/snippets/html.lua deleted file mode 100644 index af7be73..0000000 --- a/.vim/snippets/html.lua +++ /dev/null @@ -1,49 +0,0 @@ ----@diagnostic disable: undefined-global -return { - s( - 'html:5', - fmt( - [[ -<!DOCTYPE html> -<html lang="en"> - -<head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="color-scheme" content="dark light"> - <title>{title}</title> - <link href="{style}" rel="stylesheet"> - <script src="{script}"></script> -</head> - -<body> - {body} -</body> - -</html> - ]], - { - title = i(1, 'my title'), - style = i(2, 'style.css'), - script = i(3, 'main.js'), - body = i(0), - } - ) - ), - s('anchor', fmt([[<a href="{}">{}</a>]], { i(1), i(2) })), - s( - 'journal', - fmt( - [[ -<article> - <h2>{}</h2> - <p>{}</p> -</article> - ]], - { - i(1, os.date('%Y-%m-%d, %a')), - i(0), - } - ) - ), -} diff --git a/.vim/snippets/javascript.lua b/.vim/snippets/javascript.lua deleted file mode 100644 index 4c7b8e3..0000000 --- a/.vim/snippets/javascript.lua +++ /dev/null @@ -1,26 +0,0 @@ ----@diagnostic disable: undefined-global - -local jsdoc_s = function(ctx, snip) - return s(ctx, snip, { - show_condition = cond.ts('comment'), - }) -end - -return { - s({ trig = 'jsdoc', name = 'JSDoc comment' }, { - t('/**'), - nl(), - t(' * '), - i(1), - nl(), - t(' */'), - }), - jsdoc_s( - { trig = 'param', name = 'JSDoc @param' }, - { t('@param '), t('{'), i(1), t('}'), t(' '), i(2) } - ), - jsdoc_s( - { trig = 'return', name = 'JSDoc @return' }, - { t('@return '), t('{'), i(1), t('}'), t(' ') } - ), -} diff --git a/.vim/snippets/license_eupl.txt b/.vim/snippets/license_eupl.txt deleted file mode 100644 index 4153cd3..0000000 --- a/.vim/snippets/license_eupl.txt +++ /dev/null @@ -1,287 +0,0 @@ - EUROPEAN UNION PUBLIC LICENCE v. 1.2 - EUPL © the European Union 2007, 2016 - -This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined -below) which is provided under the terms of this Licence. Any use of the Work, -other than as authorised under this Licence is prohibited (to the extent such -use is covered by a right of the copyright holder of the Work). - -The Work is provided under the terms of this Licence when the Licensor (as -defined below) has placed the following notice immediately following the -copyright notice for the Work: - - Licensed under the EUPL - -or has expressed by any other means his willingness to license under the EUPL. - -1. Definitions - -In this Licence, the following terms have the following meaning: - -- ‘The Licence’: this Licence. - -- ‘The Original Work’: the work or software distributed or communicated by the - Licensor under this Licence, available as Source Code and also as Executable - Code as the case may be. - -- ‘Derivative Works’: the works or software that could be created by the - Licensee, based upon the Original Work or modifications thereof. This Licence - does not define the extent of modification or dependence on the Original Work - required in order to classify a work as a Derivative Work; this extent is - determined by copyright law applicable in the country mentioned in Article 15. - -- ‘The Work’: the Original Work or its Derivative Works. - -- ‘The Source Code’: the human-readable form of the Work which is the most - convenient for people to study and modify. - -- ‘The Executable Code’: any code which has generally been compiled and which is - meant to be interpreted by a computer as a program. - -- ‘The Licensor’: the natural or legal person that distributes or communicates - the Work under the Licence. - -- ‘Contributor(s)’: any natural or legal person who modifies the Work under the - Licence, or otherwise contributes to the creation of a Derivative Work. - -- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of - the Work under the terms of the Licence. - -- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending, - renting, distributing, communicating, transmitting, or otherwise making - available, online or offline, copies of the Work or providing access to its - essential functionalities at the disposal of any other natural or legal - person. - -2. Scope of the rights granted by the Licence - -The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, -sublicensable licence to do the following, for the duration of copyright vested -in the Original Work: - -- use the Work in any circumstance and for all usage, -- reproduce the Work, -- modify the Work, and make Derivative Works based upon the Work, -- communicate to the public, including the right to make available or display - the Work or copies thereof to the public and perform publicly, as the case may - be, the Work, -- distribute the Work or copies thereof, -- lend and rent the Work or copies thereof, -- sublicense rights in the Work or copies thereof. - -Those rights can be exercised on any media, supports and formats, whether now -known or later invented, as far as the applicable law permits so. - -In the countries where moral rights apply, the Licensor waives his right to -exercise his moral right to the extent allowed by law in order to make effective -the licence of the economic rights here above listed. - -The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to -any patents held by the Licensor, to the extent necessary to make use of the -rights granted on the Work under this Licence. - -3. Communication of the Source Code - -The Licensor may provide the Work either in its Source Code form, or as -Executable Code. If the Work is provided as Executable Code, the Licensor -provides in addition a machine-readable copy of the Source Code of the Work -along with each copy of the Work that the Licensor distributes or indicates, in -a notice following the copyright notice attached to the Work, a repository where -the Source Code is easily and freely accessible for as long as the Licensor -continues to distribute or communicate the Work. - -4. Limitations on copyright - -Nothing in this Licence is intended to deprive the Licensee of the benefits from -any exception or limitation to the exclusive rights of the rights owners in the -Work, of the exhaustion of those rights or of other applicable limitations -thereto. - -5. Obligations of the Licensee - -The grant of the rights mentioned above is subject to some restrictions and -obligations imposed on the Licensee. Those obligations are the following: - -Attribution right: The Licensee shall keep intact all copyright, patent or -trademarks notices and all notices that refer to the Licence and to the -disclaimer of warranties. The Licensee must include a copy of such notices and a -copy of the Licence with every copy of the Work he/she distributes or -communicates. The Licensee must cause any Derivative Work to carry prominent -notices stating that the Work has been modified and the date of modification. - -Copyleft clause: If the Licensee distributes or communicates copies of the -Original Works or Derivative Works, this Distribution or Communication will be -done under the terms of this Licence or of a later version of this Licence -unless the Original Work is expressly distributed only under this version of the -Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee -(becoming Licensor) cannot offer or impose any additional terms or conditions on -the Work or Derivative Work that alter or restrict the terms of the Licence. - -Compatibility clause: If the Licensee Distributes or Communicates Derivative -Works or copies thereof based upon both the Work and another work licensed under -a Compatible Licence, this Distribution or Communication can be done under the -terms of this Compatible Licence. For the sake of this clause, ‘Compatible -Licence’ refers to the licences listed in the appendix attached to this Licence. -Should the Licensee's obligations under the Compatible Licence conflict with -his/her obligations under this Licence, the obligations of the Compatible -Licence shall prevail. - -Provision of Source Code: When distributing or communicating copies of the Work, -the Licensee will provide a machine-readable copy of the Source Code or indicate -a repository where this Source will be easily and freely available for as long -as the Licensee continues to distribute or communicate the Work. - -Legal Protection: This Licence does not grant permission to use the trade names, -trademarks, service marks, or names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the copyright notice. - -6. Chain of Authorship - -The original Licensor warrants that the copyright in the Original Work granted -hereunder is owned by him/her or licensed to him/her and that he/she has the -power and authority to grant the Licence. - -Each Contributor warrants that the copyright in the modifications he/she brings -to the Work are owned by him/her or licensed to him/her and that he/she has the -power and authority to grant the Licence. - -Each time You accept the Licence, the original Licensor and subsequent -Contributors grant You a licence to their contributions to the Work, under the -terms of this Licence. - -7. Disclaimer of Warranty - -The Work is a work in progress, which is continuously improved by numerous -Contributors. It is not a finished work and may therefore contain defects or -‘bugs’ inherent to this type of development. - -For the above reason, the Work is provided under the Licence on an ‘as is’ basis -and without warranties of any kind concerning the Work, including without -limitation merchantability, fitness for a particular purpose, absence of defects -or errors, accuracy, non-infringement of intellectual property rights other than -copyright as stated in Article 6 of this Licence. - -This disclaimer of warranty is an essential part of the Licence and a condition -for the grant of any rights to the Work. - -8. Disclaimer of Liability - -Except in the cases of wilful misconduct or damages directly caused to natural -persons, the Licensor will in no event be liable for any direct or indirect, -material or moral, damages of any kind, arising out of the Licence or of the use -of the Work, including without limitation, damages for loss of goodwill, work -stoppage, computer failure or malfunction, loss of data or any commercial -damage, even if the Licensor has been advised of the possibility of such damage. -However, the Licensor will be liable under statutory product liability laws as -far such laws apply to the Work. - -9. Additional agreements - -While distributing the Work, You may choose to conclude an additional agreement, -defining obligations or services consistent with this Licence. However, if -accepting obligations, You may act only on your own behalf and on your sole -responsibility, not on behalf of the original Licensor or any other Contributor, -and only if You agree to indemnify, defend, and hold each Contributor harmless -for any liability incurred by, or claims asserted against such Contributor by -the fact You have accepted any warranty or additional liability. - -10. Acceptance of the Licence - -The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ -placed under the bottom of a window displaying the text of this Licence or by -affirming consent in any other similar way, in accordance with the rules of -applicable law. Clicking on that icon indicates your clear and irrevocable -acceptance of this Licence and all of its terms and conditions. - -Similarly, you irrevocably accept this Licence and all of its terms and -conditions by exercising any rights granted to You by Article 2 of this Licence, -such as the use of the Work, the creation by You of a Derivative Work or the -Distribution or Communication by You of the Work or copies thereof. - -11. Information to the public - -In case of any Distribution or Communication of the Work by means of electronic -communication by You (for example, by offering to download the Work from a -remote location) the distribution channel or media (for example, a website) must -at least provide to the public the information requested by the applicable law -regarding the Licensor, the Licence and the way it may be accessible, concluded, -stored and reproduced by the Licensee. - -12. Termination of the Licence - -The Licence and the rights granted hereunder will terminate automatically upon -any breach by the Licensee of the terms of the Licence. - -Such a termination will not terminate the licences of any person who has -received the Work from the Licensee under the Licence, provided such persons -remain in full compliance with the Licence. - -13. Miscellaneous - -Without prejudice of Article 9 above, the Licence represents the complete -agreement between the Parties as to the Work. - -If any provision of the Licence is invalid or unenforceable under applicable -law, this will not affect the validity or enforceability of the Licence as a -whole. Such provision will be construed or reformed so as necessary to make it -valid and enforceable. - -The European Commission may publish other linguistic versions or new versions of -this Licence or updated versions of the Appendix, so far this is required and -reasonable, without reducing the scope of the rights granted by the Licence. New -versions of the Licence will be published with a unique version number. - -All linguistic versions of this Licence, approved by the European Commission, -have identical value. Parties can take advantage of the linguistic version of -their choice. - -14. Jurisdiction - -Without prejudice to specific agreement between parties, - -- any litigation resulting from the interpretation of this License, arising - between the European Union institutions, bodies, offices or agencies, as a - Licensor, and any Licensee, will be subject to the jurisdiction of the Court - of Justice of the European Union, as laid down in article 272 of the Treaty on - the Functioning of the European Union, - -- any litigation arising between other parties and resulting from the - interpretation of this License, will be subject to the exclusive jurisdiction - of the competent court where the Licensor resides or conducts its primary - business. - -15. Applicable Law - -Without prejudice to specific agreement between parties, - -- this Licence shall be governed by the law of the European Union Member State - where the Licensor has his seat, resides or has his registered office, - -- this licence shall be governed by Belgian law if the Licensor has no seat, - residence or registered office inside a European Union Member State. - -Appendix - -‘Compatible Licences’ according to Article 5 EUPL are: - -- GNU General Public License (GPL) v. 2, v. 3 -- GNU Affero General Public License (AGPL) v. 3 -- Open Software License (OSL) v. 2.1, v. 3.0 -- Eclipse Public License (EPL) v. 1.0 -- CeCILL v. 2.0, v. 2.1 -- Mozilla Public Licence (MPL) v. 2 -- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3 -- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for - works other than software -- European Union Public Licence (EUPL) v. 1.1, v. 1.2 -- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong - Reciprocity (LiLiQ-R+). - -The European Commission may update this Appendix to later versions of the above -licences without producing a new version of the EUPL, as long as they provide -the rights granted in Article 2 of this Licence and protect the covered Source -Code from exclusive appropriation. - -All other changes or additions to this Appendix require the production of a new -EUPL version. diff --git a/.vim/snippets/license_mit0.txt b/.vim/snippets/license_mit0.txt deleted file mode 100644 index a5f0b4b..0000000 --- a/.vim/snippets/license_mit0.txt +++ /dev/null @@ -1,18 +0,0 @@ -MIT No Attribution - -Copyright 2024 Robert Günzler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.vim/snippets/mail.lua b/.vim/snippets/mail.lua deleted file mode 100644 index e57902c..0000000 --- a/.vim/snippets/mail.lua +++ /dev/null @@ -1,17 +0,0 @@ ----@diagnostic disable: undefined-global -return { - s( - 'Sehr geehrte', - fmt( - [[ -Sehr geehrte Damen und Herren, - -{} - -Mit freundlichen Grüßen, -{} -]], - { i(0), i(1) } - ) - ), -} diff --git a/.vim/snippets/markdown.lua b/.vim/snippets/markdown.lua deleted file mode 100644 index 221f301..0000000 --- a/.vim/snippets/markdown.lua +++ /dev/null @@ -1,20 +0,0 @@ ----@diagnostic disable: undefined-global -return { - s( - 'bugs', - fmt( - [[ -## bugs, help, patches? - -submit them to my [public-inbox](https://lists.sr.ht/~robertgzr/public-inbox) by sending an email to [~robertgzr/public-inbox@lists.sr.ht](mailto:~robertgzr/public-inbox@lists.sr.ht?Subject=%5B{proj}%5D%20) -]], - { proj = i(1, 'project name') } - ) - ), - - s('date', { - t('<span class="date">'), - i(1), - t('</span>'), - }), -} diff --git a/.vim/snippets/sh_script.txt b/.vim/snippets/sh_script.txt deleted file mode 100644 index eab45a3..0000000 --- a/.vim/snippets/sh_script.txt +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -eu -[ -n "${DEBUG:-}" ] && set -x - -main() { - printf 'Hello world\n' -} - -main "$@" diff --git a/.vim/snippets/zig.lua b/.vim/snippets/zig.lua deleted file mode 100644 index 3a7d12f..0000000 --- a/.vim/snippets/zig.lua +++ /dev/null @@ -1,13 +0,0 @@ ----@diagnostic disable: undefined-global -return { - s('str', t('[]const u8')), - s('fn_C', fmt('fn {}({}) callconv(.C) {}', { i(0), i(1), i(2) })), - s('debug', { - t('std.log.debug("'), - i(1, '{any}'), - t('", .{'), - i(2), - t('});'), - i(0), - }), -} |