repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: incubator for plugins and nvim patches (lua)

83ed855f3300589dbe071ffa7c1f18dabca56d97

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (6)

neovim/lua/bugabinga/plugins/in-and-out.lua

Added
new file mode 100644
1 +local map = require 'std.map'
3 +map.insert {
4 + description = 'Moves in or out of balanced tokens',
5 + category = 'editing',
6 + keys = '<c-space>',
7 + command = function () require 'in-and-out'.in_and_out() end,
8 +}
10 +return {
11 + 'ysmb-wtsg/in-and-out.nvim',
12 + commit = 'ab24cafadc3418dffb0c7e9b0621cff60b9ac551',
13 + event = 'VeryLazy',

neovim/lua/bugabinga/plugins/incubator.lua

Added
new file mode 100644
1 +local ignored = require 'std.ignored'
2 +local icon = require 'std.icon'
4 +-- this file lists plugins in their "incubation" phase.
5 +-- that means i am testing those out of curiosity, but am not sure yet i wish
6 +-- to use and depend on them.
7 +--
8 +return {
9 + -------------------------------------------------------------------------------
10 + {
11 + 'gregorias/toggle.nvim',
12 + lazy = false,
13 + version = '2.0',
14 + config = true,
15 + },
16 + -------------------------------------------------------------------------------
17 + {
18 + 'quentingruber/timespent.nvim',
19 + keys = {
20 + {
21 + '<leader>tS',
22 + '<cmd>:ShowTimeSpent<cr>',
23 + mode = {
24 + 'n',
25 + },
26 + desc = 'Show time spent',
27 + },
28 + },
29 + },
30 + -------------------------------------------------------------------------------
31 + {
32 + 'nvim-telescope/telescope-frecency.nvim',
33 + config = function ()
34 + require 'telescope'.load_extension 'frecency'
35 + end,
36 + keys = {
37 + {
38 + '<c-p><c-f>',
39 + '<cmd>Telescope frecency<cr>',
40 + mode = { 'n' },
41 + desc = 'telescope: Show recently and frequently used files.',
42 + },
43 + },
44 + },
46 + {
47 + 'cenk1cenk2/scratch.nvim',
48 + },
49 + -------------------------------------------------------------------------------
50 + {
51 + 'AdeAttwood/ivy.nvim',
52 + lazy = false,
53 + build = 'cargo build --release',
54 + opts = {},
55 + },
56 + -------------------------------------------------------------------------------
57 + {
58 + 'rachartier/tiny-inline-diagnostic.nvim',
59 + event = 'LspAttach',
60 + config = function ()
61 + require 'tiny-inline-diagnostic'.setup()
62 + end,
63 + },
64 + -------------------------------------------------------------------------------
65 + {
66 + 'chrisgrieser/nvim-lsp-endhints',
67 + event = 'LspAttach',
68 + opts = {
69 + icons = {
70 + type = icon.tye,
71 + parameter = icon.paramter,
72 + offspec = '', -- hint kind not defined in official LSP spec
73 + unknown = icon.hint, -- hint kind
74 + },
75 + label = {
76 + padding = 2,
77 + },
78 + },
79 + },
80 + -------------------------------------------------------------------------------
81 + {
82 + 'ravibrock/spellwarn.nvim',
83 + event = 'VeryLazy',
84 + config = true,
85 + },
86 + -------------------------------------------------------------------------------
87 + {
88 + 'emmanueltouzery/decisive.nvim',
89 + config = function ()
90 + require 'decisive'.setup {}
91 + end,
92 + lazy = true,
93 + ft = { 'csv' },
94 + keys = {
95 + { '<leader>cca', ":lua require('decisive').align_csv({})<cr>", { silent = true }, desc = 'Align CSV', mode = 'n' },
96 + { '<leader>ccA', ":lua require('decisive').align_csv_clear({})<cr>", { silent = true }, desc = 'Align CSV clear', mode = 'n' },
97 + { '[c', ":lua require('decisive').align_csv_prev_col()<cr>", { silent = true }, desc = 'Align CSV prev col', mode = 'n' },
98 + { ']c', ":lua require('decisive').align_csv_next_col()<cr>", { silent = true }, desc = 'Align CSV next col', mode = 'n' },
99 + },
100 + },
101 + -------------------------------------------------------------------------------
103 + 'tris203/precognition.nvim',
104 + event = 'VeryLazy',
105 + opts = {
106 + startVisible = true,
107 + showBlankVirtLine = true,
108 + highlightColor = { link = 'LineNr' },
109 + -- hints = {
110 + -- Caret = { text = "^", prio = 2 },
111 + -- Dollar = { text = "$", prio = 1 },
112 + -- MatchingPair = { text = "%", prio = 5 },
113 + -- Zero = { text = "0", prio = 1 },
114 + -- w = { text = "w", prio = 10 },
115 + -- b = { text = "b", prio = 9 },
116 + -- e = { text = "e", prio = 8 },
117 + -- W = { text = "W", prio = 7 },
118 + -- B = { text = "B", prio = 6 },
119 + -- E = { text = "E", prio = 5 },
120 + -- },
121 + -- gutterHints = {
122 + -- G = { text = "G", prio = 10 },
123 + -- gg = { text = "gg", prio = 9 },
124 + -- PrevParagraph = { text = "{", prio = 8 },
125 + -- NextParagraph = { text = "}", prio = 8 },
126 + -- },
127 + disabled_fts = ignored.filetypes,
128 + },
129 + },
130 + -------------------------------------------------------------------------------

neovim/lua/bugabinga/plugins/markdown-table-mode.lua

Added
new file mode 100644
1 +return {
2 + 'Kicamon/markdown-table-mode.nvim',
3 + commit = 'f830cd15a97deb3acc53d9f6607bc609f7f32e49',
4 + ft = 'markdown',
5 + opts = {},
6 +}

neovim/lua/patches/init.lua

Added
new file mode 100644
1 +require 'patches.snippet'

neovim/lua/patches/snippet.lua

Added
new file mode 100644
1 +--- source https://boltlessengineer.github.io/posts/neovim-config-without-plugins/
2 +---
3 +---@param trigger string trigger string for snippet
4 +---@param body string snippet text that will be expanded
5 +---@param opts? vim.keymap.set.Opts
6 +---
7 +---Refer to <https://microsoft.github.io/language-server-protocol/specification/#snippet_syntax>
8 +---for the specification of valid body.
9 +function vim.snippet.add( trigger, body, opts )
10 + vim.keymap.set( 'ia', trigger, function ()
11 + -- If abbrev is expanded with keys like "(", ")", "<cr>", "<space>",
12 + -- don't expand the snippet. Only accept "<c-]>" as trigger key.
13 + local c = vim.fn.nr2char( vim.fn.getchar( 0 ) )
14 + if c ~= '' then
15 + vim.api.nvim_feedkeys( trigger .. c, 'i', true )
16 + return
17 + end
18 + vim.snippet.expand( body )
19 + end, opts )
20 +end

neovim/lua/std/const.lua

Added
new file mode 100644
1 +return {
2 + win32 = vim.loop.os_uname().sysname:match 'Win',
3 + wsl2 = vim.loop.os_uname().release:match 'WSL2',
4 + os_background = (function ()
5 + -- Default value
6 + local background = 'light'
7 + local uname = vim.uv.os_uname()
8 + -- First check whether we are on WSL or Windows
9 + if vim.loop.os_uname().release:match 'WSL2' then
10 + -- Check if 'reg.exe' is executable
11 + if vim.fn.executable 'reg.exe' ~= 0 then
12 + -- Execute command to check if the win32 appearance is set to Dark
13 + local appsUseLightTheme = vim.fn.system { 'reg.exe', 'Query',
14 + 'HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize', '/v', 'AppsUseLightTheme' }
15 + if not appsUseLightTheme:find '0x1' then
16 + background = 'dark'
17 + end
18 + end
19 + -- Check if 'busctl' is executable (part of systemd)
20 + elseif vim.fn.executable 'busctl' ~= 0 then
21 + -- Get the current color scheme from xdg-desktop-portal using busctl
22 + local result = vim.fn.system {
23 + 'busctl', '--user', 'call', 'org.freedesktop.portal.Desktop', '/org/freedesktop/portal/desktop',
24 + 'org.freedesktop.portal.Settings', 'ReadOne', 'ss', 'org.freedesktop.appearance', 'color-scheme',
25 + }
26 + -- The result is in the form of "v u 0" for light and "v u 1" for dark
27 + local color_scheme = result:match 'u%s+(%d+)'
29 + if color_scheme == '1' then
30 + background = 'dark'
31 + end
32 + else
33 + end
35 + return background
36 + end)(),