repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge branch 'trunk' of https://github.com/bugabinga/dotfiles into trunk

c2566d15a45a9b5634238e3d6fd0a67f9fd2e91e

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (37)

environment.d/path.conf

Modified
1 1 CARGO_HOME = /home/oli/.cargo
2 2 GO_HOME = /home/oli/go
3 -PATH = $CARGO_HOME/bin:$GO_HOME/bin:$PATH
3 +LTEX_HOME = /home/oli/Tools/ltex-ls-16.0.0
4 +PATH = $CARGO_HOME/bin:$GO_HOME/bin:$LTEX_HOME/bin:$PATH

neovim/.luarc.json

Added
new file mode 100644
1 +{
2 + "diagnostics.globals": [
3 + "vim"
4 + ]
5 +}

neovim/README.md

Modified
49 49 # todo
51 -* neoterm keymaps
52 -* learn mini.operators
53 51 * create skeleton-plugin for default file content based on file type
54 - (BufNewFile?)
55 -* add support for Java multi line string in autopairs
56 -* use a static treesitter config
57 -* setup LSP keybinds again
52 + * user command for creating new file
53 + * :Skeletor java class -> java files with correct package and boilerplate (class, interface, record,...)

neovim/Untitled

Added
new file mode 100644

neovim/colors/nugu.lua

Modified
1 1 local const = require 'std.const'
3 --- Reset all highlights if another colorscheme was previously set
4 -vim.cmd [[ highlight clear ]]
5 -vim.opt.background = const.os_background
3 +if vim.g.colors_name then
4 + -- Reset all highlights if another colorscheme was previously set
5 + vim.cmd [[ highlight clear ]]
6 +else
7 + -- only set bg, first time nugu is loaded
8 + vim.opt.background = const.os_background
9 +end
7 11 vim.g.colors_name = 'nugu'

neovim/init.lua

Modified
11 11 -- Setup debug mode
12 12 vim.g.bugabinga_debug_mode = true
13 +-- start `profiler.nvim` with `NVIM_PROFILE=1 nvim ...`
14 +-- or `NVIM_PROFILE=start nvim ...`
15 +-- then hit <F12> to save profile.
16 +-- inspect profile on https://ui.perfetto.dev
17 +require 'bugabinga.profile'
14 -local start_time = vim.uv.hrtime()
19 +local start_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field
15 20 local auto = require 'std.auto'
16 21 auto 'measure_startup_time' {
17 22 events = 'VimEnter',
18 23 description = 'Measure startup time of neovim.',
19 24 once = true,
20 - command = function()
21 - local end_time = vim.uv.hrtime()
25 + command = function ()
26 + local end_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field
22 27 local time_elapsed = end_time - start_time
23 - vim.notify(string.format('Neovim started in (%d ms).', time_elapsed / 1e6),
24 - vim.log.levels.INFO)
28 + vim.notify( string.format( 'Neovim started in (%d ms).', time_elapsed / 1e6 ),
29 + vim.log.levels.INFO )
25 30 end,
30 35 require 'patches'
37 +--[[ MY STUFF ]] --
32 38 require 'bugabinga.options'
33 39 require 'bugabinga.sessions'
34 40 require 'bugabinga.treesitter'
35 41 require 'bugabinga.bigfile'
36 -require 'bugabinga.neovim_devel'
37 -require 'bugabinga.lsp'
38 42 require 'bugabinga.editorconfig'
39 43 require 'bugabinga.save_actions'
40 -require 'bugabinga.diagnostic'
41 -require 'bugabinga.in_and_out'
42 -require 'bugabinga.mkdir'
44 +vim.schedule( function ()
45 + require 'bugabinga.in_and_out'
46 + require 'bugabinga.mkdir'
47 + require 'bugabinga.diagnostic'
48 + -- FIXME why does LSP not start, when scheduled?
49 + require 'bugabinga.lsp'
50 +end )
52 +--[[ PLUGINS ]] --
53 +require 'bugabinga.neovim_devel'
44 54 require 'bugabinga.file_explorer'
45 55 require 'bugabinga.virtual_column'
46 56 require 'bugabinga.align'
52 62 require 'bugabinga.format'
53 63 require 'bugabinga.jump2d'
54 64 require 'bugabinga.lint'
65 +require 'bugabinga.search_and_replace'
55 66 require 'bugabinga.move'
56 67 require 'bugabinga.navigation'
57 68 require 'bugabinga.notifications'
63 74 require 'bugabinga.textobjects'
64 75 require 'bugabinga.key_preview'
65 76 require 'bugabinga.patterns'
77 +require 'bugabinga.pairs'
66 78 require 'bugabinga.terminal'
68 80 require 'bugabinga.incubator'

neovim/justfile

Modified
8 8 repro:
9 9 nvim -u repro.lua
11 +puk:
12 + nu puk.nu
14 +puke:
15 + nu puk.nu update
11 17 # delete all current neovim state, cache and other ephemeral data. does NOT delete the configs
12 18 nuke:
13 19 rm --interactive --recursive --force (nvim "--headless" "--clean" +'lua print(vim.fn.stdpath[[data]])' +q | complete | get stderr)

neovim/lua/bugabinga/completion.lua

Modified
1 1 local puk = require 'std.puk'
2 2 local blink = puk 'blink.cmp'
3 +vim.cmd.packadd 'friendly-snippets'
3 4 blink.setup {}
4 5 return blink

neovim/lua/bugabinga/file_explorer.lua

Modified
26 26 columns = { 'icon' },
27 27 win_options = {
28 + wrap = true,
28 29 cursorline = true,
29 30 -- show CWD in winbar. needs global function, see above
30 31 winbar = "%!v:lua.get_oil_winbar()",
59 60 border = vim.g.border_style,
61 62 view_options = {
62 - is_always_hidden = function(name) return name == '..' end,
63 63 show_hidden = true,
64 + natural_order = true,
65 + is_always_hidden = function(name) return name == '..' end,

neovim/lua/bugabinga/incubator.lua

Modified
14 14 --- does not yet restore well with session
15 15 --- cannot navigate with C-w inside the DocsView
16 16 --- it has a manual update mode, but which key to bind it to?
17 -puk.defer 'docs-view' (function(docsview)
17 +puk.defer 'docs-view' ( function ( docsview )
18 18 docsview.setup {
19 19 position = 'right',
20 20 width = 42,
24 24 keys = '<leader>tk',
25 25 command = '<cmd>DocsViewToggle<cr>',
27 -end)
27 +end )
28 28 -------------------------------------------------------------------------------
29 29 --- this is pretty great! i just need better binds and tell which key about them
30 -puk.defer 'rulebook' (function(rulebook)
31 - rulebook.setup ()
30 +puk.defer 'rulebook' ( function ( rulebook )
31 + rulebook.setup()
32 32 map.normal {
33 33 description = 'ignore rule',
34 34 category = 'lint',
53 53 keys = '<leader>rf',
54 54 command = rulebook.suppressFormatter,
56 -end)
56 +end )
57 57 -------------------------------------------------------------------------------
58 58 --- this plugin has some sick visual text formatting chops. check them out some time.
59 -puk.defer 'symbol-usage'(function(symbolusage)
59 +puk.defer 'symbol-usage' ( function ( symbolusage )
60 60 symbolusage.setup {
61 61 hi = { link = 'LineNr' },
62 62 vt_position = 'end_of_line',
67 67 log = { enabled = dbg.get() },
69 -end)
69 +end )
70 70 -------------------------------------------------------------------------------
71 71 --- Pretty NICE!
72 72 --- fix highlights to match nugu.
73 -puk.defer 'glance' (function(glance)
73 +puk.defer 'glance' ( function ( glance )
74 74 glance.setup()
75 75 map.normal {
76 76 description = 'peek definitions',
77 77 category = 'lsp',
78 - keys = '<Leader>lpd',
78 + keys = 'grpd',
79 79 command = '<cmd>Glance definitions<cr>',
81 81 map.normal {
82 82 description = 'Peek references',
83 83 category = 'lsp',
84 - keys = '<Leader>lpr',
84 + keys = 'grpr',
85 85 command = '<cmd>Glance references<cr>',
87 87 map.normal {
88 88 description = 'Peek type definitions',
89 89 category = 'lsp',
90 - keys = '<Leader>lpt',
90 + keys = 'grpt',
91 91 command = '<cmd>Glance type_definitions<cr>',
93 93 map.normal {
94 94 description = 'Peek implementations',
95 - keys = '<Leader>lpi',
95 + keys = 'grpi',
96 96 command = '<cmd>Glance implementations<cr>',
98 -end)
98 +end )
99 +-------------------------------------------------------------------------------
100 +puk.defer 'tiny-inline-diagnostic' ( function ( tiny )
101 + tiny.setup {
102 + options = {
103 + -- Show the source of the diagnostic.
104 + show_source = true,
106 + -- Use your defined signs in the diagnostic config table.
107 + use_icons_from_diagnostic = true,
108 + },
110 +end )
99 111 -------------------------------------------------------------------------------

neovim/lua/bugabinga/jump2d.lua

Modified
1 1 local puk = require 'std.puk'
2 2 puk.defer 'mini.jump2d' (function(jump2d)
3 - jump2d.setup {}
3 + jump2d.setup {
4 + -- Function producing jump spots (byte indexed) for a particular line.
5 + spotter = jump2d.builtin_opts.word_start.spotter,
6 + -- Characters used for labels of jump spots (in supplied order)
7 + labels = 'hjklgfdsabceimnoyrtuvwxzpq',
8 + -- Options for visual effects
9 + view = {
10 + -- How many steps ahead to show. Set to big number to show all steps.
11 + n_steps_ahead = 1,
12 + },
13 + -- Which lines are used for computing spots
14 + allowed_lines = {
15 + blank = false, -- Blank line (not sent to spotter even if `true`)
16 + fold = false, -- Start of fold (not sent to spotter even if `true`)
17 + },
18 + silent = true,
19 + }
4 20 end)

neovim/lua/bugabinga/key_preview.lua

Modified
2 2 local puk = require 'std.puk'
4 4 puk.defer 'mini.clue' (function(clue)
5 5 clue.setup {
6 + window = {
7 + config = {
8 + width = 'auto'
9 + }
10 + },
6 11 triggers = {
7 12 -- Leader triggers
8 13 { mode = 'n', keys = '<Leader>' },
37 42 clues = {
38 43 -- Enhance this by adding descriptions for <Leader> mapping groups
39 44 { mode = 'n', keys = '<Leader>t', desc = '+Toggle' },
40 - { mode = 'n', keys = '<Leader>l', desc = '+LSP' },
41 - { mode = 'n', keys = '<Leader>lp', desc = '+Peek' },
42 45 { mode = 'n', keys = '<Leader>r', desc = '+Rules' },
43 - { mode = 'n', keys = '<Leader>f', desc = '+Find' },
44 46 { mode = 'n', keys = '<Leader>x', desc = '+Neovim' },
47 + { mode = 'n', keys = '<Leader>o', desc = '+Operators' },
48 + { mode = 'n', keys = 'grw', desc = '+Workspace' },
49 + { mode = 'n', keys = 'grp', desc = '+Peek' },
45 50 clue.gen_clues.builtin_completion(),
46 51 clue.gen_clues.g(),
47 52 clue.gen_clues.marks(),

neovim/lua/bugabinga/lsp.lua

Modified
125 125 local capabilities = vim.lsp.protocol.make_client_capabilities()
126 126 config.capabilities = require('bugabinga.completion').get_lsp_capabilities(config.capabilities)
127 127 capabilities = table.extend('force', capabilities, config.capabilities)
128 - local settings = config.settings or {}
129 - -- TODO reimplement local settings overrides
128 + -- local settings = config.settings or {}
129 + -- TODO Re-implement local settings overrides
130 130 -- local settings_override = local_settings(server) or {}
131 131 -- config.settings = table.extend('force', settings, settings_override)
132 132 lspconfig[server].setup(config)
141 141 vim.lsp.completion.enable(true, client_id, bufnr)
143 + -- the following are already set by default
144 + -- but i will remap them anyways for consistency
146 + map.normal {
147 + description = 'code action',
148 + category = 'lsp',
149 + keys = 'gra',
150 + command = vim.lsp.buf.code_action,
152 + map.normal {
153 + description = 'implementation',
154 + category = 'lsp',
155 + keys = 'gri',
156 + command = vim.lsp.buf.implementation,
158 + map.normal {
159 + description = 'rename',
160 + category = 'lsp',
161 + keys = 'grn',
162 + command = vim.lsp.buf.rename,
164 + map.normal {
165 + description = 'references',
166 + category = 'lsp',
167 + keys = 'grr',
168 + command = vim.lsp.buf.references,
171 + -- create mappings for rest of lsp functions in the default style: gr prefix
172 + map.normal {
173 + description = 'definition',
174 + category = 'lsp',
175 + keys = 'grd',
176 + command = vim.lsp.buf.definition,
178 + map.normal {
179 + description = 'list workspace folders',
180 + category = 'lsp',
181 + keys = 'grwl',
182 + command = vim.lsp.buf.list_workspace_folders,
184 + map.normal {
185 + description = 'add workspace folder',
186 + category = 'lsp',
187 + keys = 'grwa',
188 + command = vim.lsp.buf.add_workspace_folder,
190 + map.normal {
191 + description = 'remove workspace folder',
192 + category = 'lsp',
193 + keys = 'grwr',
194 + command = vim.lsp.buf.remove_workspace_folder,
196 + map.normal {
197 + description = 'incoming calls',
198 + category = 'lsp',
199 + keys = 'grc',
200 + command = vim.lsp.buf.incoming_calls,
202 + map.normal {
203 + description = 'outgoing calls',
204 + category = 'lsp',
205 + keys = 'grC',
206 + command = vim.lsp.buf.outgoing_calls,
208 + map.normal {
209 + description = 'type definition',
210 + category = 'lsp',
211 + keys = 'grt',
212 + command = vim.lsp.buf.type_definition,
214 + map.normal {
215 + description = 'type hierarchy (subtypes)',
216 + category = 'lsp',
217 + keys = 'grh',
218 + command = function() vim.lsp.buf.typehierarchy 'subtypes' end,
220 + map.normal {
221 + description = 'type hierarchy (supertypes)',
222 + category = 'lsp',
223 + keys = 'grH',
224 + command = function() vim.lsp.buf.typehierarchy 'supertypes' end,
227 + map.insert {
228 + description = 'signature help',
229 + category = 'lsp',
230 + keys = '<c-space>',
231 + command = vim.lsp.buf.signature_help,
143 234 if client.server_capabilities.inlayHintProvider then
144 235 map.normal {
145 236 description = 'Toggle inlay hints',

neovim/lua/bugabinga/neovim_devel.lua

Modified
11 11 -- Needs `justinsgithub/wezterm-types` to be installed
12 12 { path = "wezterm-types", mods = { "wezterm" } },
14 - -- disable when a .luarc.json file is found
15 14 enabled = function(root_dir)
16 15 return not vim.uv.fs_stat(root_dir .. "/.lsp.settings.lua")
17 16 end,

neovim/lua/bugabinga/nugu/init.lua

Modified
41 41 vim.g.terminal_color_14 = content_focus -- aqua
42 42 vim.g.terminal_color_15 = content_normal -- white
44 -local set_group_properties = function ( self, properties )
44 +local set_group_properties = function(self, properties)
45 45 vim.validate {
46 46 properties = { properties, 'table' },
47 47 -- • fg (or foreground): color name or "#RRGGBB", see note.
84 84 ['properties.force'] = { properties.force, 'boolean', true },
86 86 -- vim.print( 'SET GROUP PROPERTIES', self, properties )
87 - for key, value in pairs( properties ) do
87 + for key, value in pairs(properties) do
88 88 self[key] = value
92 -local new_group = function ()
93 - return setmetatable( {}, {
92 +local new_group = function()
93 + return setmetatable({}, {
94 94 __call = set_group_properties,
95 - } )
95 + })
98 -local add_group = function ( self, key )
98 +local add_group = function(self, key)
99 99 if not self.groups[key] then
100 100 self.groups[key] = new_group()
102 102 return self.groups[key]
105 -local link_group = function ( self, key, value )
105 +local link_group = function(self, key, value)
106 106 -- vim.print( 'linking group', self, key, value )
107 - local group = add_group( self, key )
108 - for name, group_link in pairs( self.groups ) do
107 + local group = add_group(self, key)
108 + for name, group_link in pairs(self.groups) do
109 109 if group_link == value then
110 110 -- vim.print( 'found group to link ' .. name .. ' to ' .. key )
111 111 group.link = name
117 -local _ = setmetatable( { groups = {} }, {
117 +local _ = setmetatable({ groups = {} }, {
118 118 __index = add_group,
119 119 __newindex = link_group,
120 -} )
122 122 _.Debug { fg = ui_normal, bg = debug, bold = true }
125 125 _.NormalUi { fg = ui_normal, bg = ui_backdrop }
126 126 _.NormalFloat { bg = _.NormalUi.bg }
127 127 _.FloatBorder { fg = ui_accent, bg = _.NormalFloat.bg }
128 +_.FloatBorderCorner { fg = ui_accent, bg = _.Normal.bg }
128 129 _.FloatTitle { fg = _.FloatBorder.fg, bg = _.FloatBorder.bg, bold = true }
129 130 _.EndOfBuffer { bg = _.Normal.bg }
130 131 _.Comment { fg = content_important_global }
260 261 _.LspInlayHint { fg = content_minor, bg = _.Normal.bg }
261 262 _.LspSignatureActiveParameter = _.Debug
264 +-- NeoTreeGitAdded File name when the git status is added.
265 +_.NeoTreeGitAdded = _.DiffAdd
266 +-- NeoTreeGitConflict File name when the git status is conflict.
267 +_.NeoTreeGitConflict = _.DiffChange
268 +-- NeoTreeGitDeleted File name when the git status is deleted.
269 +_.NeoTreeGitDeleted = _.DiffDelete
270 +-- NeoTreeGitIgnored File name when the git status is ignored.
271 +-- NeoTreeGitModified File name when the git status is modified.
272 +_.NeoTreeGitModified = _.DiffChange
273 +-- NeoTreeGitUnstaged Used for git unstaged symbol.
274 +_.NeoTreeGitUnstaged = _.DiffChange
275 +-- NeoTreeGitUntracked File name when the git status is untracked.
276 +_.NeoTreeGitUntracked = _.DiffChange
277 +-- NeoTreeGitStaged Used for git staged symbol.
278 +_.NeoTreeGitStaged = _.DiffText
280 +_.MiniHipatternsFixme { fg = ui_normal, bg = _.DiagnosticError.fg }
281 +_.MiniHipatternsHack { fg = ui_normal, bg = _.DiagnosticWarn.fg }
282 +_.MiniHipatternsTodo { fg = ui_normal, bg = _.DiagnosticHint.fg }
283 +_.MiniHipatternsNote { fg = ui_normal, bg = _.DiagnosticInfo.fg }
263 285 _['@text.literal'] = _.Comment
264 286 _['@text.reference'] = _.Identifier
265 287 _['@text.title'] = _.Title
329 351 _['@lsp.type.macro'] = _['@macro']
330 352 _['@lsp.type.decorator'] = _['@function']
332 -return function ()
354 +return function()
333 355 local namespace = 0
334 - for name, group in pairs( _.groups ) do
335 - vim.api.nvim_set_hl( namespace, name, group )
356 + for name, group in pairs(_.groups) do
357 + vim.api.nvim_set_hl(namespace, name, group)

neovim/lua/bugabinga/operators.lua

Modified
1 1 local puk = require 'std.puk'
2 -puk.defer 'mini.operators' (function (operators)
3 - operators.setup {}
2 +puk.defer 'mini.operators' (function(operators)
3 + operators.setup {
4 + -- Evaluate text and replace with output
5 + evaluate = { prefix = '<leader>o=' },
6 + -- Exchange text regions
7 + exchange = { prefix = '<leader>ox' },
8 + -- Multiply (duplicate) text
9 + multiply = { prefix = '<leader>om' },
10 + -- Replace text with register
11 + replace = { prefix = '<leader>or' },
12 + -- Sort text
13 + sort = { prefix = '<leader>os' }
14 + }
4 15 end)

neovim/lua/bugabinga/options/behaviour.lua

Modified
35 35 vim.cmd.colorscheme 'nugu'
36 36 end,
39 --- Stolen from mini.misc plugin at https://github.com/echasnovski/mini.misc
41 -local restore_cursor = function()
42 - -- Stop if not a normal buffer
43 - if vim.bo.buftype ~= '' then return end
45 - -- Stop if filetype is ignored
46 - if vim.tbl_contains(ignored.filetypes, vim.bo.filetype) then return end
48 - -- Stop if line is already specified (like during start with `nvim file +num`)
49 - local cursor_line = vim.api.nvim_win_get_cursor(0)[1]
50 - if cursor_line > 1 then return end
52 - -- Stop if can't restore proper line for some reason
53 - local mark_line = vim.api.nvim_buf_get_mark(0, [["]])[1]
54 - local n_lines = vim.api.nvim_buf_line_count(0)
55 - if not (1 <= mark_line and mark_line <= n_lines) then return end
57 - -- Restore cursor and open just enough folds
58 - vim.cmd [[normal! g`"zv]]
60 - -- Center window
61 - vim.cmd 'normal! zz'
62 -end
64 --- Create autocommand which runs once on `FileType` for every new buffer
65 -auto 'restore_cursor_position_setup' {
66 - description = 'Setup function to restore cursor position',
67 - events = 'BufReadPre',
68 - command = function(data)
69 - auto 'restore_cursor_position' {
70 - description = 'Restores last known cursor position when opening a buffer.',
71 - events = 'FileType',
72 - buffer = data.buf,
73 - once = true,
74 - command = restore_cursor,
75 - }
76 - end,
77 -}

neovim/lua/bugabinga/options/init.lua

Modified
9 9 vim.g.loaded_node_provider = 0
10 10 vim.g.loaded_perl_provider = 0
12 +-- Disable builtin statusline of qf window
13 +vim.g.qf_disable_statusline = 1
12 15 -- add new filetypes rearly on
13 16 require 'bugabinga.options.filetypes'
93 96 -- enable mouse
94 97 vim.opt.mouse = 'a'
95 98 -- disable popup menu on right click
96 -vim.opt.mousemodel = 'extend'
99 +vim.opt.mousemodel = 'popup_setpos'
98 --- if vim.fn.executable 'nu' then
99 --- -- integrate Nushell with nvim
100 --- vim.opt.shell = 'nu'
101 --- -- flags for nu:
102 --- -- * `--stdin` redirect all input to -c
103 --- -- * `--no-newline` do not append `\n` to stdout
104 --- -- * `--commands` execute a command
105 --- vim.opt.shellcmdflag = '--stdin --no-newline --commands'
106 --- -- string to be used to put the output of shell commands in a temp file
107 --- -- 1. when 'shelltemp' is `true`
108 --- -- 2. in the `diff-mode` (`nvim -d file1 file2`) when `diffopt` is set
109 --- -- to use an external diff command: `set diffopt-=internal`
110 --- vim.opt.shellredir = 'out+err> "%s"'
111 --- -- string to be used with `:make` command to:
112 --- -- 1. save the stderr of `makeprg` in the temp file which Neovim reads using `errorformat` to populate the `quickfix` buffer
113 --- -- 2. show the stdout, stderr on the screen
114 --- -- NOTE: `ansi strip` removes all ansi coloring from nushell errors
115 --- vim.opt.shellpipe =
116 --- '| complete | get stderr stdout | str join (char nl) | ansi strip | tee { save --force --raw "%s" }'
117 --- -- WARN: disable the usage of temp files for shell commands
118 --- -- because Nu doesn't support `input redirection` which Neovim uses to send buffer content to a command:
119 --- -- `{shell_command} < {temp_file_with_selected_buffer_content}`
120 --- -- When set to `false` the stdin pipe will be used instead.
121 --- -- NOTE: some info about `shelltemp`: https://github.com/neovim/neovim/issues/1008
122 --- vim.opt.shelltemp = false
123 --- vim.opt.shellxquote = ''
124 --- vim.opt.shellxescape = ''
125 --- vim.opt.shellquote = ''
126 --- end
101 +if vim.fn.executable 'nu' then
102 + -- setting the shell too early can block startup
103 + vim.schedule(function()
104 + -- integrate Nushell with nvim
105 + vim.opt.shell = 'nu'
106 + -- flags for nu:
107 + -- * `--stdin` redirect all input to -c
108 + -- * `--no-newline` do not append `\n` to stdout
109 + -- * `--commands` execute a command
110 + vim.opt.shellcmdflag = '--stdin --no-newline --commands'
111 + -- string to be used to put the output of shell commands in a temp file
112 + -- 1. when 'shelltemp' is `true`
113 + -- 2. in the `diff-mode` (`nvim -d file1 file2`) when `diffopt` is set
114 + -- to use an external diff command: `set diffopt-=internal`
115 + vim.opt.shellredir = 'out+err> "%s"'
116 + -- string to be used with `:make` command to:
117 + -- 1. save the stderr of `makeprg` in the temp file which Neovim reads using `errorformat` to populate the `quickfix` buffer
118 + -- 2. show the stdout, stderr on the screen
119 + -- NOTE: `ansi strip` removes all ansi coloring from nushell errors
120 + vim.opt.shellpipe =
121 + '| complete | get stderr stdout | str join (char nl) | ansi strip | tee { save --force --raw "%s" }'
122 + -- WARN: disable the usage of temp files for shell commands
123 + -- because Nu doesn't support `input redirection` which Neovim uses to send buffer content to a command:
124 + -- `{shell_command} < {temp_file_with_selected_buffer_content}`
125 + -- When set to `false` the stdin pipe will be used instead.
126 + -- NOTE: some info about `shelltemp`: https://github.com/neovim/neovim/issues/1008
127 + vim.opt.shelltemp = false
128 + vim.opt.shellxquote = ''
129 + vim.opt.shellxescape = ''
130 + vim.opt.shellquote = ''
131 + end)
132 +end
128 --- require 'bugabinga.health'.add_dependency
129 --- {
130 --- name = 'Nushell',
131 --- name_of_executable = 'nu',
132 --- }
134 +require 'bugabinga.health'.add_dependency
136 + name = 'Nushell',
137 + name_of_executable = 'nu',
134 140 -- highlight all search matches
135 141 vim.opt.hlsearch = true
201 207 vim.opt.showcmd = false
203 209 -- autocomplete menu in command buffer
204 -vim.opt.wildmode = 'list:longest'
210 +vim.opt.wildmode = 'full'
205 211 vim.opt.wildignorecase = true
212 +vim.opt.wildoptions = 'fuzzy,pum'
207 214 -- virtually break lines on border
264 271 vim.opt.winblend = 0
266 273 -- use this in various places for consistent border style
267 -vim.g.border_style = 'single'
274 +vim.g.border_style = {
275 + { "🬷", 'FloatBorderCorner' }, -- top left
276 + { "▔", 'FloatBorder' }, -- top
277 + { "🬲", 'FloatBorderCorner' }, -- top right
278 + { "🮈", 'FloatBorder' }, -- right
279 + { "🬕", 'FloatBorderCorner' }, -- bottom right
280 + { "▁", 'FloatBorder' }, -- bottom
281 + { "🬨", 'FloatBorderCorner' }, -- bottom left
282 + { "▍", 'FloatBorder' }, -- left
269 285 -- hide the mode indicator in status
270 286 vim.opt.showmode = false
314 330 require 'bugabinga.options.keymaps'
315 331 require 'bugabinga.options.spelling'
316 332 require 'bugabinga.options.commands'
333 +require 'bugabinga.options.menus'

neovim/lua/bugabinga/options/menus.lua

Added
new file mode 100644
1 +-- disable friendly beginner message in context menu
2 +vim.cmd.aunmenu [[PopUp.How-to\ disable\ mouse]]
4 +vim.iter(pairs(vim.lsp.buf))
5 + :filter(function(_, action)
6 + return type(action) == 'function'
7 + end)
8 + :each(function(name, _)
9 + vim.cmd.anoremenu('PopUp.' .. name .. ' <cmd>lua vim.lsp.buf.' .. name .. '()<cr>')
10 + end)

neovim/lua/bugabinga/pairs.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
3 +puk.defer 'mini.pairs' (function(pairs)
4 + pairs.setup {}
5 +end)

neovim/lua/bugabinga/patterns.lua

Modified
1 1 local puk = require 'std.puk'
3 -puk.defer 'mini.hipatterns' (function(patterns)
3 +puk.defer 'mini.hipatterns' ( function ( patterns )
4 4 patterns.setup {
5 5 highlighters = {
6 6 -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
12 12 -- Highlight hex color strings (`#rrggbb`) using that color
13 13 hex_color = patterns.gen_highlighter.hex_color(),
15 - -- Delays (in ms) defining asynchronous highlighting process
15 + -- Delays (in milliseconds) defining asynchronous highlighting process
16 16 delay = {
17 17 -- How much to wait for update after every text change
18 18 text_change = 690,
21 21 scroll = 420,
24 -end)
24 +end )

neovim/lua/bugabinga/profile.lua

Added
new file mode 100644
1 +--- Starts `profile.nvim`, if special `NVIM_PROFILE` environment variable is set.
2 +--- This file intentionally does not import any other Lua files, in order to not
3 +--- skew the later profiling results with cached modules.
5 +local should_profile = os.getenv 'NVIM_PROFILE'
6 +if should_profile then
7 + vim.cmd.packadd 'profile'
8 + require 'profile'.instrument_autocmds()
9 + if should_profile:lower():match '^start' then
10 + require 'profile'.start '*'
11 + else
12 + require 'profile'.instrument '*'
13 + end
14 +end
16 +local function toggle_profile()
17 + local prof = require 'profile'
18 + if prof.is_recording() then
19 + prof.stop()
20 + vim.ui.input( { prompt = 'Save profile to:', completion = 'file', default = 'profile.json' }, function ( filename )
21 + if filename then
22 + prof.export( filename )
23 + vim.notify( string.format( 'Wrote %s', filename ) )
24 + end
25 + end )
26 + else
27 + prof.start '*'
28 + end
29 +end
30 +vim.keymap.set( '', '<F12>', toggle_profile )

neovim/lua/bugabinga/search_and_replace.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
2 +local map = require 'std.map'
4 +puk.defer 'grug-far' ( function ( grug )
5 + grug.setup {}
7 + map.normal {
8 + description = 'search and replace current word',
9 + category = 'find',
10 + keys = '<F4>',
11 + command = function () grug.open { prefills = { search = vim.fn.expand '<cword>' } } end,
12 + }
13 +end )
15 +-- TODO: check grug-far README for binding in oil.nvim

neovim/lua/bugabinga/splitjoin.lua

Modified
1 1 local puk = require 'std.puk'
2 2 local map = require 'std.map'
3 -local auto = require 'std.auto'
3 +puk.defer 'mini.splitjoin' ( function ( splitjoin )
4 + splitjoin.setup()
5 -local treesj = puk 'treesj'
6 -local splitjoin = puk 'mini.splitjoin'
8 -treesj.setup {
9 - use_default_keymaps = false,
10 - max_join_length = 360,
11 -}
12 -splitjoin.setup()
14 -map.normal {
15 - description = 'Toggle Tree Join/Split',
16 - category = 'editing',
17 - keys = '<c-j>',
18 - command = function()
19 - local langs = require 'treesj.langs'['presets']
20 - if langs[vim.bo.filetype] then
21 - treesj.toggle { split = { recursive = false } }
22 - else
6 + map.normal {
7 + description = 'Toggle Tree Join/Split',
8 + category = 'editing',
9 + keys = '<c-j>',
10 + command = function ()
23 11 splitjoin.toggle()
24 - end
25 - end,
26 -}
12 + end,
13 + }
14 +end )

neovim/lua/bugabinga/terminal.lua

Modified
1 -local puk = require 'std.puk'
2 1 local map = require 'std.map'
2 +local user_command = require 'std.user_command'
4 -puk.defer 'neoterm' (function(neoterm)
5 - neoterm.setup {
6 - clear_on_run = true, -- Run clear command before user specified commands
7 - position = 'center', -- Position of the terminal window: fullscreen (0), top (1), right (2), bottom (3), left (4), center (5) (string or integer value)
8 - noinsert = false, -- Disable entering insert mode when opening the neoterm window
9 - width = 0.69, -- Width of the terminal window (percentage, ratio, or range between 0-1)
10 - height = 0.69, -- Height of the terminal window (percentage, ratio, or range between 0-1)
4 +local state = {
5 + float = {
6 + buffer = -1,
7 + window = -1,
9 +}
13 - map.normal.terminal {
14 - description = 'Toggle terminal',
15 - category = 'terminal',
16 - keys = '<leader>tt',
17 - command = neoterm.toggle,
11 +local open_float = function(options)
12 + options = options or {}
13 + local max_width = vim.o.columns
14 + local max_height = vim.o.lines
15 + local size = options.size or 0.88
16 + local width = options.width or math.floor(max_width * size)
17 + local height = options.height or math.floor(max_height * size)
18 + local center_col = math.floor((max_width - width) / 2)
19 + local center_row = math.floor((max_height - height) / 2)
20 + local buffer_created = false
21 + local create_buffer = function()
22 + buffer_created = true
23 + return vim.api.nvim_create_buf(false, true)
24 + end
25 + local buffer = vim.api.nvim_buf_is_valid(options.buffer) and options.buffer
26 + or create_buffer()
27 + local window_settings = {
28 + relative = "editor",
29 + width = width,
30 + height = height,
31 + col = center_col,
32 + row = center_row,
33 + style = 'minimal',
34 + border = options.border or vim.g.border_style,
19 -end)
36 + local window = vim.api.nvim_open_win(buffer, true, window_settings)
37 + if buffer_created then
38 + vim.cmd.terminal('nu --login')
39 + end
40 + vim.cmd.startinsert()
41 + local buffer_options = {
42 + buflisted = false,
43 + }
44 + for buffer_option, value in pairs(buffer_options) do
45 + vim.api.nvim_set_option_value(buffer_option, value, {
46 + buf = buffer,
47 + })
48 + end
49 + local window_options = {
50 + winbar = '',
51 + }
52 + for window_option, value in pairs(window_options) do
53 + vim.api.nvim_set_option_value(window_option, value, {
54 + win = window,
55 + })
56 + end
57 + return {
58 + buffer = buffer,
59 + window = window,
60 + }
61 +end
63 +local toggle_terminal = function()
64 + if vim.api.nvim_win_is_valid(state.float.window) then
65 + vim.api.nvim_win_hide(state.float.window)
66 + else
67 + state.float = open_float(state.float)
68 + end
69 +end
71 +user_command.Terminal 'Toggle Terminal in floating window' (toggle_terminal)
72 +map.normal.terminal {
73 + description = 'Toggle terminal',
74 + category = 'terminal',
75 + keys = '<F7>',
76 + command = toggle_terminal,
78 +map.terminal {
79 + description = 'Enter normal mode',
80 + category = 'terminal',
81 + keys = '<esc><esc>',
82 + command = '<c-\\><c-n>'

neovim/lua/std/cheatsheet.lua

Added
new file mode 100644
1 +local buffer_options = {
2 + bufhidden = 'hide',
3 + modifiable = false,
4 + filetype = 'markdown', -- Alternative: use help ft
5 +}
7 +local window_border = 'shadow'
9 +local window_options = {
10 + winblend = 42,
13 +local open = function()
14 + -- create unlisted scratch buffer
15 + local buffer = vim.api.nvim_create_buf(false, true)
17 + -- must be done, before buffer is set to unmodifiable
18 + vim.api.nvim_buf_set_lines(buffer, 0, 1, false, {
19 + '# Cheat Sheet',
20 + '',
21 + '> Remember the following keymaps!'
22 + -- TODO: where to get this from? from std.map
23 + })
25 + for name, value in pairs(buffer_options) do
26 + vim.api.nvim_set_option_value(name, value, {
27 + scope = 'local',
28 + buf = buffer,
29 + })
30 + end
32 + local half_height = math.ceil(vim.o.lines * 0.5)
33 + local half_width = math.ceil(vim.o.columns * 0.5)
35 + local window = vim.api.nvim_open_win(buffer, true, {
36 + border = window_border,
37 + relative = 'editor',
38 + style = 'minimal',
39 + height = half_height,
40 + width = half_width,
41 + row = math.ceil(half_height * 0.5),
42 + col = math.ceil(half_width * 0.5),
43 + })
45 + for name, value in pairs(window_options) do
46 + vim.api.nvim_set_option_value(name, value, {
47 + scope = 'local',
48 + win = window,
49 + })
50 + end
52 + local close = function()
53 + vim.api.nvim_win_hide(window)
54 + end
56 + local buffer_keymaps = {
57 + { 'n', '<esc>', close },
58 + { 'n', 'q', close },
59 + }
61 + for _, map in ipairs(buffer_keymaps) do
62 + vim.keymap.set(map[1], map[2], map[3])
63 + end
64 +end
66 +return setmetatable(
67 + {
68 + open = open,
69 + },
70 + {
72 + })

neovim/lua/std/const.lua

Modified
1 1 local uname = vim.uv.os_uname()
2 -local win32 = vim.uv.os_uname().sysname:match 'Win' and true or false
3 -local wsl = vim.uv.os_uname().release:match 'WSL2' and true or false
2 +local win32 = uname.sysname:match 'Win' and true or false
3 +local wsl = uname.release:match 'WSL2' and true or false
5 5 local os_background = function ()
6 6 -- Default value

neovim/lua/std/ignored.lua

Modified
10 10 'notify',
11 11 'Glance',
12 12 'nvim-docs-view',
13 + 'neo-tree',
14 + 'neo-tree-popup',
13 15 'oil',
14 16 'qf',
15 17 'svn',

neovim/puk.nu

Modified
140 140 spec: record # a plugin to install
142 142 let url_format = match $spec.source {
143 - github => { 'https://github.com/{repo}/archive/{commit}.tar.gz ' },
143 + github => { 'https://github.com/{repo}/archive/{commit}.tar.gz' },
144 144 codeberg => { 'https://codeberg.org/{repo}/archive/{commit}.tar.gz' },
145 145 srht => { 'https://git.sr.ht/{repo}/archive/{commit}.tar.gz' },
146 146 _ => { error make {
193 193 _ => { error make { msg: 'unknown operating system' } },
195 195 let allowed_filetypes = [ lua vim scm txt $allowed_shared_lib_type ]
196 +let exclusions = [
197 + **/tests/**,
198 + **/test/**,
199 + **/perf/**,
200 + **/scripts/**,
201 + **/fixtures/**,
202 + **/scrapers/**,
203 + **/spec/**,
204 + **/target/release/deps/**
197 207 def install-plugin [
198 208 spec: record # a plugin to install
203 213 try { rm --trash --recursive $plugin_path }
204 214 mkdir $plugin_path
205 215 cd $folder_path
206 - let exclusions = [**/tests/**, **/scripts/**, **/fixtures/**, **/target/release/deps/**]
207 216 glob $"**/*.{($allowed_filetypes | str join ',')}" --exclude $exclusions |
208 217 path relative-to (pwd) |
209 218 par-each { | file |

neovim/puk.plugins.nuon

Modified
12 12 github,
13 13 neovim/nvim-lspconfig,
14 14 master,
15 - "47f236c058f0511702286a21ba53bbf42abbd8a8",
15 + "040001d85e9190a904d0e35ef5774633e14d8475",
20 20 github,
21 21 nvim-treesitter/nvim-treesitter,
22 22 main,
23 - "75904bdff7da13cb54e05f53f25f25a924fe28a6",
23 + "71bb6f603cd97674ac674e8c4e263ac0a1c50d6e",
25 25 nvim,
26 26 --headless,
52 52 github,
53 53 "stevearc/oil.nvim",
54 54 master,
55 - "9a59256c8e88b29d2150e99b5960b2f111e51f75",
55 + "dba037598843973b8c54bc5ce0318db4a0da439d",
60 60 github,
61 61 "Saghen/blink.cmp",
62 62 main,
63 - "765ee4cfb6d71e9d88a27f64f406251f3aa85fac",
63 + "5a71e8e01f44084de9f7351f1e2bef74cdc0c450",
65 65 cargo,
66 66 build,
75 75 "9f0cb495f25bff32c936062d85046fbda0c43517",
78 - [
79 - neoterm,
80 - github,
81 - "itmecho/neoterm.nvim",
82 - main,
83 - "23a780136892b1128485f20d772a771e528b651b",
84 - null
85 - ],
87 79 conform,
88 80 github,
89 81 "stevearc/conform.nvim",
90 82 master,
91 - "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8",
83 + "f4e8837878fc5712d053ba3091a73d27d96a09e2",
96 88 github,
97 89 "j-hui/fidget.nvim",
98 90 main,
99 - "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f",
91 + "9238947645ce17d96f30842e61ba81147185b657",
123 115 "f34975103a38b3f608219a1324cdfc58ea660b8b",
119 + "mini.pairs",
120 + github,
121 + "echasnovski/mini.pairs",
122 + main,
123 + "7e834c5937d95364cc1740e20d673afe2d034cdb",
124 + null
125 + ],
127 127 "mini.clue",
128 128 github,
144 144 github,
145 145 "echasnovski/mini.align",
147 - "26111a737494bc39576ad67b52bbc2638ca23553",
147 + "acf1ad6031e49553ed887a2a5e3603211346f1de",
168 168 github,
169 169 "echasnovski/mini.jump2d",
171 - "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6",
171 + "88077058297e80f1c76a18ed801ae9d7064187c6",
200 200 github,
201 201 "echasnovski/mini.icons",
203 - "54686be7d58807906cb2c8c2216e0bf9c044f19a",
203 + "44c0160526f7ae17ca8e8eab9ab235d047fcf7a6",
224 224 github,
225 225 mfussenegger/nvim-lint,
226 226 master,
227 - "6b46370d02cd001509a765591a3ffc481b538794",
228 - null
229 - ],
230 - [
231 - treesj,
232 - github,
233 - Wansmer/treesj,
234 - main,
235 - "03415ac60791d48e120a80d37e080744faf3ac15",
227 + "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55",
264 256 github,
265 257 amrbashir/nvim-docs-view,
266 258 master,
267 - "365593534e0acd762bfddce6e8313315ffa4fa36",
259 + "1b97f8f954d74c46061bf289b6cea9232484c12c",
272 264 github,
273 265 chrisgrieser/nvim-rulebook,
275 - "e57a154b316a986a10d98f14acb2f822d0153029",
267 + "7325802d4cfdcfd55a51c165290779bc835a0cd3",
288 280 github,
289 281 "folke/lazydev.nvim",
291 - "f59bd14a852ca43db38e3662395354cb2a9b13e0",
283 + "8620f82ee3f59ff2187647167b6b47387a13a018",
299 291 "1518752906ba3fac0060d9efab6e4d3ec15d4b5a",
293 + ],
295 + profile,
296 + github,
297 + "nvim-lua/plenary.nvim",
298 + master,
299 + "2d9b06177a975543726ce5c73fca176cedbffe9d",
300 + null
301 + ],
303 + friendly-snippets,
304 + github,
305 + rafamadriz/friendly-snippets,
306 + main,
307 + "efff286dd74c22f731cdec26a70b46e5b203c619",
308 + null
309 + ],
311 + tiny-inline-diagnostic,
312 + github,
313 + "rachartier/tiny-inline-diagnostic.nvim",
314 + main,
315 + "66d9166520a0cb3392a5ef68946fd3980d57383f",
316 + null
317 + ],
319 + grug-far,
320 + github,
321 + "MagicDuck/grug-far.nvim",
322 + main,
323 + "11d0fbd6fff6f4e394af95319deeaab4ef88ce97",
324 + null

neovim/skeleton/lua/plugin.lua

Added
new file mode 100644
1 +return function()
2 + return [[
3 +local puk = require 'std.puk'
5 +puk.defer'{{ NAME }}'(function({{ NAME }})
6 + {{ CURSOR }}
7 +end)
8 +]]
9 +end

neovim/spell/nerd.utf-8.add

Modified
134 134 Produktlandschaft
136 136 Log4J2
137 +Vorhand
138 +Rückhandbelag
139 +Vorhandbelag
140 +Fastarc
141 +Nittaku
142 +Griffform
143 +Noppen
144 +Tibhar
145 +Kopfgröße

neovim/spell/nerd.utf-8.add.spl

Modified

Previous version contains binary or non-UTF-8 data.

Current version contains binary or non-UTF-8 data.

wezterm/bugabinga/code_fonts.csv

Modified
68 68 1,Monoid
69 69 1,Monospace
70 70 0,MonteCarlo Fixed 12
71 -1,NanumGothic_Coding
71 +0,NanumGothic_Coding
72 72 0,NotCourierSans
73 73 1,Office Code Pro
74 74 1,Office Code Pro D

wezterm/bugabinga/launch.lua

Modified
2 2 local wez = require 'wezterm'
4 4 return function ( cfg )
5 5 cfg.launch_menu = {
6 + {
7 + label = 'Upgrade',
8 + args = { 'topgrade', },
9 + cwd = wez.home_dir,
10 + },
7 12 label = 'Editor',
8 13 args = { 'nvim', },

wezterm/wezterm.service

Modified
6 6 Restart=on-failure
8 8 [Install]
9 -WantedBy=default.target
9 +WantedBy=graphical-session.target

zed/settings.json

Modified
10 10 "assistant": {
11 11 "default_model": {
12 12 "provider": "copilot_chat",
13 - "model": "gpt-4o"
13 + "model": "claude-3-5-sonnet"
15 15 "version": "2"
17 17 "features": {
18 18 "copilot": false
20 - "theme": "Oxocarbon Dark (IBM Carbon)",
20 + "theme": "Serendipity Midnight",
21 21 "vim_mode": true,
22 22 "vim": {
23 23 "use_smartcase_find": true,
26 26 "ui_font_size": 16,
27 27 "ui_font_family": "Intel One Mono",
28 28 "unstable.ui_density": "comfortable",
29 - "buffer_font_family": "Cousine",
29 + "buffer_font_family": "Monaspace Krypton Var",
30 30 "buffer_line_height": "comfortable",
31 - "buffer_font_size": 24,
31 + "buffer_font_size": 18,
32 32 "cursor_blink": false,
33 33 "show_whitespaces": "selection",
34 34 "show_completions_on_input": false,