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)

+615 / −212 text lines · all files grouped into 32 bars · 1 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately

Diff layout

environment.d/path.conf

Modified

+2 / −1 text lines

11CARGO_HOME = /home/oli/.cargo
22GO_HOME = /home/oli/go
3PATH = $CARGO_HOME/bin:$GO_HOME/bin:$PATH
3LTEX_HOME = /home/oli/Tools/ltex-ls-16.0.0
4PATH = $CARGO_HOME/bin:$GO_HOME/bin:$LTEX_HOME/bin:$PATH

neovim/.luarc.json

Added
new file mode 100644

+5 / −0 text lines

1{
2 "diagnostics.globals": [
3 "vim"
4 ]
5}No final newline

neovim/README.md

Modified

+2 / −6 text lines

4949# todo
51* neoterm keymaps
52* learn mini.operators
5351* 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

+1 / −0 text lines

neovim/colors/nugu.lua

Modified

+7 / −3 text lines

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

neovim/init.lua

Modified

+22 / −10 text lines

1111-- Setup debug mode
1212vim.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
17require 'bugabinga.profile'
14local start_time = vim.uv.hrtime()
19local start_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field
1520local auto = require 'std.auto'
1621auto 'measure_startup_time' {
1722 events = 'VimEnter',
1823 description = 'Measure startup time of neovim.',
1924 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
2227 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 )
2530 end,
3035require 'patches'
37--[[ MY STUFF ]] --
3238require 'bugabinga.options'
3339require 'bugabinga.sessions'
3440require 'bugabinga.treesitter'
3541require 'bugabinga.bigfile'
36require 'bugabinga.neovim_devel'
37require 'bugabinga.lsp'
3842require 'bugabinga.editorconfig'
3943require 'bugabinga.save_actions'
40require 'bugabinga.diagnostic'
41require 'bugabinga.in_and_out'
42require 'bugabinga.mkdir'
44vim.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'
50end )
52--[[ PLUGINS ]] --
53require 'bugabinga.neovim_devel'
4454require 'bugabinga.file_explorer'
4555require 'bugabinga.virtual_column'
4656require 'bugabinga.align'
5262require 'bugabinga.format'
5363require 'bugabinga.jump2d'
5464require 'bugabinga.lint'
65require 'bugabinga.search_and_replace'
5566require 'bugabinga.move'
5667require 'bugabinga.navigation'
5768require 'bugabinga.notifications'
6374require 'bugabinga.textobjects'
6475require 'bugabinga.key_preview'
6576require 'bugabinga.patterns'
77require 'bugabinga.pairs'
6678require 'bugabinga.terminal'
6880require 'bugabinga.incubator'

neovim/justfile

Modified

+6 / −0 text lines

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

neovim/lua/bugabinga/completion.lua

Modified

+1 / −0 text lines

11local puk = require 'std.puk'
22local blink = puk 'blink.cmp'
3vim.cmd.packadd 'friendly-snippets'
34blink.setup {}
45return blink

neovim/lua/bugabinga/file_explorer.lua

Modified

+3 / −1 text lines

2626 columns = { 'icon' },
2727 win_options = {
28 wrap = true,
2829 cursorline = true,
2930 -- show CWD in winbar. needs global function, see above
3031 winbar = "%!v:lua.get_oil_winbar()",
5960 border = vim.g.border_style,
6061 },
6162 view_options = {
62 is_always_hidden = function(name) return name == '..' end,
6363 show_hidden = true,
64 natural_order = true,
65 is_always_hidden = function(name) return name == '..' end,
6466 },

neovim/lua/bugabinga/incubator.lua

Modified

+25 / −13 text lines

1414--- does not yet restore well with session
1515--- cannot navigate with C-w inside the DocsView
1616--- it has a manual update mode, but which key to bind it to?
17puk.defer 'docs-view' (function(docsview)
17puk.defer 'docs-view' ( function ( docsview )
1818 docsview.setup {
1919 position = 'right',
2020 width = 42,
2424 keys = '<leader>tk',
2525 command = '<cmd>DocsViewToggle<cr>',
2626 }
27end)
27end )
2828-------------------------------------------------------------------------------
2929--- this is pretty great! i just need better binds and tell which key about them
30puk.defer 'rulebook' (function(rulebook)
31 rulebook.setup ()
30puk.defer 'rulebook' ( function ( rulebook )
31 rulebook.setup()
3232 map.normal {
3333 description = 'ignore rule',
3434 category = 'lint',
5353 keys = '<leader>rf',
5454 command = rulebook.suppressFormatter,
5555 }
56end)
56end )
5757-------------------------------------------------------------------------------
5858--- this plugin has some sick visual text formatting chops. check them out some time.
59puk.defer 'symbol-usage'(function(symbolusage)
59puk.defer 'symbol-usage' ( function ( symbolusage )
6060 symbolusage.setup {
6161 hi = { link = 'LineNr' },
6262 vt_position = 'end_of_line',
6666 },
6767 log = { enabled = dbg.get() },
6868 }
69end)
69end )
7070-------------------------------------------------------------------------------
7171--- Pretty NICE!
7272--- fix highlights to match nugu.
73puk.defer 'glance' (function(glance)
73puk.defer 'glance' ( function ( glance )
7474 glance.setup()
7575 map.normal {
7676 description = 'peek definitions',
7777 category = 'lsp',
78 keys = '<Leader>lpd',
78 keys = 'grpd',
7979 command = '<cmd>Glance definitions<cr>',
8080 }
8181 map.normal {
8282 description = 'Peek references',
8383 category = 'lsp',
84 keys = '<Leader>lpr',
84 keys = 'grpr',
8585 command = '<cmd>Glance references<cr>',
8686 }
8787 map.normal {
8888 description = 'Peek type definitions',
8989 category = 'lsp',
90 keys = '<Leader>lpt',
90 keys = 'grpt',
9191 command = '<cmd>Glance type_definitions<cr>',
9292 }
9393 map.normal {
9494 description = 'Peek implementations',
95 keys = '<Leader>lpi',
95 keys = 'grpi',
9696 command = '<cmd>Glance implementations<cr>',
9797 }
98end)
98end )
99-------------------------------------------------------------------------------
100puk.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 },
109 }
110end )
99111-------------------------------------------------------------------------------

neovim/lua/bugabinga/jump2d.lua

Modified

+17 / −1 text lines

11local puk = require 'std.puk'
22puk.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 }
420end)

neovim/lua/bugabinga/key_preview.lua

Modified

+8 / −3 text lines

33puk.defer 'mini.clue' (function(clue)
44 clue.setup {
5 window = {
6 config = {
7 width = 'auto'
8 }
9 },
510 triggers = {
611 -- Leader triggers
712 { mode = 'n', keys = '<Leader>' },
3742 clues = {
3843 -- Enhance this by adding descriptions for <Leader> mapping groups
3944 { mode = 'n', keys = '<Leader>t', desc = '+Toggle' },
40 { mode = 'n', keys = '<Leader>l', desc = '+LSP' },
41 { mode = 'n', keys = '<Leader>lp', desc = '+Peek' },
4245 { mode = 'n', keys = '<Leader>r', desc = '+Rules' },
43 { mode = 'n', keys = '<Leader>f', desc = '+Find' },
4446 { 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' },
4550 clue.gen_clues.builtin_completion(),
4651 clue.gen_clues.g(),
4752 clue.gen_clues.marks(),

neovim/lua/bugabinga/lsp.lua

Modified

+93 / −2 text lines

125125 local capabilities = vim.lsp.protocol.make_client_capabilities()
126126 config.capabilities = require('bugabinga.completion').get_lsp_capabilities(config.capabilities)
127127 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
130130 -- local settings_override = local_settings(server) or {}
131131 -- config.settings = table.extend('force', settings, settings_override)
132132 lspconfig[server].setup(config)
141141 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,
151 }
152 map.normal {
153 description = 'implementation',
154 category = 'lsp',
155 keys = 'gri',
156 command = vim.lsp.buf.implementation,
157 }
158 map.normal {
159 description = 'rename',
160 category = 'lsp',
161 keys = 'grn',
162 command = vim.lsp.buf.rename,
163 }
164 map.normal {
165 description = 'references',
166 category = 'lsp',
167 keys = 'grr',
168 command = vim.lsp.buf.references,
169 }
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,
177 }
178 map.normal {
179 description = 'list workspace folders',
180 category = 'lsp',
181 keys = 'grwl',
182 command = vim.lsp.buf.list_workspace_folders,
183 }
184 map.normal {
185 description = 'add workspace folder',
186 category = 'lsp',
187 keys = 'grwa',
188 command = vim.lsp.buf.add_workspace_folder,
189 }
190 map.normal {
191 description = 'remove workspace folder',
192 category = 'lsp',
193 keys = 'grwr',
194 command = vim.lsp.buf.remove_workspace_folder,
195 }
196 map.normal {
197 description = 'incoming calls',
198 category = 'lsp',
199 keys = 'grc',
200 command = vim.lsp.buf.incoming_calls,
201 }
202 map.normal {
203 description = 'outgoing calls',
204 category = 'lsp',
205 keys = 'grC',
206 command = vim.lsp.buf.outgoing_calls,
207 }
208 map.normal {
209 description = 'type definition',
210 category = 'lsp',
211 keys = 'grt',
212 command = vim.lsp.buf.type_definition,
213 }
214 map.normal {
215 description = 'type hierarchy (subtypes)',
216 category = 'lsp',
217 keys = 'grh',
218 command = function() vim.lsp.buf.typehierarchy 'subtypes' end,
219 }
220 map.normal {
221 description = 'type hierarchy (supertypes)',
222 category = 'lsp',
223 keys = 'grH',
224 command = function() vim.lsp.buf.typehierarchy 'supertypes' end,
225 }
227 map.insert {
228 description = 'signature help',
229 category = 'lsp',
230 keys = '<c-space>',
231 command = vim.lsp.buf.signature_help,
232 }
143234 if client.server_capabilities.inlayHintProvider then
144235 map.normal {
145236 description = 'Toggle inlay hints',

neovim/lua/bugabinga/neovim_devel.lua

Modified

+0 / −1 text lines

1111 -- Needs `justinsgithub/wezterm-types` to be installed
1212 { path = "wezterm-types", mods = { "wezterm" } },
1313 },
14 -- disable when a .luarc.json file is found
1514 enabled = function(root_dir)
1615 return not vim.uv.fs_stat(root_dir .. "/.lsp.settings.lua")
1716 end,

neovim/lua/bugabinga/nugu/init.lua

Modified

+36 / −14 text lines

4141vim.g.terminal_color_14 = content_focus -- aqua
4242vim.g.terminal_color_15 = content_normal -- white
44local set_group_properties = function ( self, properties )
44local set_group_properties = function(self, properties)
4545 vim.validate {
4646 properties = { properties, 'table' },
4747 -- • fg (or foreground): color name or "#RRGGBB", see note.
8484 ['properties.force'] = { properties.force, 'boolean', true },
8585 }
8686 -- vim.print( 'SET GROUP PROPERTIES', self, properties )
87 for key, value in pairs( properties ) do
87 for key, value in pairs(properties) do
8888 self[key] = value
8989 end
9090end
92local new_group = function ()
93 return setmetatable( {}, {
92local new_group = function()
93 return setmetatable({}, {
9494 __call = set_group_properties,
95 } )
95 })
9696end
98local add_group = function ( self, key )
98local add_group = function(self, key)
9999 if not self.groups[key] then
100100 self.groups[key] = new_group()
101101 end
102102 return self.groups[key]
103103end
105local link_group = function ( self, key, value )
105local link_group = function(self, key, value)
106106 -- 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
109109 if group_link == value then
110110 -- vim.print( 'found group to link ' .. name .. ' to ' .. key )
111111 group.link = name
114114 end
115115end
117local _ = setmetatable( { groups = {} }, {
117local _ = setmetatable({ groups = {} }, {
118118 __index = add_group,
119119 __newindex = link_group,
120} )
120})
122122_.Debug { fg = ui_normal, bg = debug, bold = true }
125125_.NormalUi { fg = ui_normal, bg = ui_backdrop }
126126_.NormalFloat { bg = _.NormalUi.bg }
127127_.FloatBorder { fg = ui_accent, bg = _.NormalFloat.bg }
128_.FloatBorderCorner { fg = ui_accent, bg = _.Normal.bg }
128129_.FloatTitle { fg = _.FloatBorder.fg, bg = _.FloatBorder.bg, bold = true }
129130_.EndOfBuffer { bg = _.Normal.bg }
130131_.Comment { fg = content_important_global }
260261_.LspInlayHint { fg = content_minor, bg = _.Normal.bg }
261262_.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 }
263285_['@text.literal'] = _.Comment
264286_['@text.reference'] = _.Identifier
265287_['@text.title'] = _.Title
329351_['@lsp.type.macro'] = _['@macro']
330352_['@lsp.type.decorator'] = _['@function']
332return function ()
354return function()
333355 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)
336358 end
337359end

neovim/lua/bugabinga/operators.lua

Modified

+13 / −2 text lines

11local puk = require 'std.puk'
2puk.defer 'mini.operators' (function (operators)
3 operators.setup {}
2puk.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 }
415end)

neovim/lua/bugabinga/options/behaviour.lua

Modified

+0 / −40 text lines

3535 vim.cmd.colorscheme 'nugu'
3636 end,
39-- Stolen from mini.misc plugin at https://github.com/echasnovski/mini.misc
41local 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'
62end
64-- Create autocommand which runs once on `FileType` for every new buffer
65auto '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

+54 / −37 text lines

99vim.g.loaded_node_provider = 0
1010vim.g.loaded_perl_provider = 0
12-- Disable builtin statusline of qf window
13vim.g.qf_disable_statusline = 1
1215-- add new filetypes rearly on
1316require 'bugabinga.options.filetypes'
9396-- enable mouse
9497vim.opt.mouse = 'a'
9598-- disable popup menu on right click
96vim.opt.mousemodel = 'extend'
99vim.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
101if 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)
132end
128-- require 'bugabinga.health'.add_dependency
129-- {
130-- name = 'Nushell',
131-- name_of_executable = 'nu',
132-- }
134require 'bugabinga.health'.add_dependency
135{
136 name = 'Nushell',
137 name_of_executable = 'nu',
138}
134140-- highlight all search matches
135141vim.opt.hlsearch = true
201207vim.opt.showcmd = false
203209-- autocomplete menu in command buffer
204vim.opt.wildmode = 'list:longest'
210vim.opt.wildmode = 'full'
205211vim.opt.wildignorecase = true
212vim.opt.wildoptions = 'fuzzy,pum'
207214-- virtually break lines on border
264271vim.opt.winblend = 0
266273-- use this in various places for consistent border style
267vim.g.border_style = 'single'
274vim.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
283}
269285-- hide the mode indicator in status
270286vim.opt.showmode = false
314330require 'bugabinga.options.keymaps'
315331require 'bugabinga.options.spelling'
316332require 'bugabinga.options.commands'
333require 'bugabinga.options.menus'

neovim/lua/bugabinga/options/menus.lua

Added
new file mode 100644

+10 / −0 text lines

1-- disable friendly beginner message in context menu
2vim.cmd.aunmenu [[PopUp.How-to\ disable\ mouse]]
3
4vim.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

+5 / −0 text lines

1local puk = require 'std.puk'
2
3puk.defer 'mini.pairs' (function(pairs)
4 pairs.setup {}
5end)

neovim/lua/bugabinga/patterns.lua

Modified

+3 / −3 text lines

11local puk = require 'std.puk'
3puk.defer 'mini.hipatterns' (function(patterns)
3puk.defer 'mini.hipatterns' ( function ( patterns )
44 patterns.setup {
55 highlighters = {
66 -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
1212 -- Highlight hex color strings (`#rrggbb`) using that color
1313 hex_color = patterns.gen_highlighter.hex_color(),
1414 },
15 -- Delays (in ms) defining asynchronous highlighting process
15 -- Delays (in milliseconds) defining asynchronous highlighting process
1616 delay = {
1717 -- How much to wait for update after every text change
1818 text_change = 690,
2121 scroll = 420,
2222 },
2323 }
24end)
24end )

neovim/lua/bugabinga/profile.lua

Added
new file mode 100644

+30 / −0 text lines

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.
4
5local should_profile = os.getenv 'NVIM_PROFILE'
6if 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
14end
16local 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
29end
30vim.keymap.set( '', '<F12>', toggle_profile )

neovim/lua/bugabinga/search_and_replace.lua

Added
new file mode 100644

+15 / −0 text lines

1local puk = require 'std.puk'
2local map = require 'std.map'
3
4puk.defer 'grug-far' ( function ( grug )
5 grug.setup {}
6
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 }
13end )
15-- TODO: check grug-far README for binding in oil.nvim

neovim/lua/bugabinga/splitjoin.lua

Modified

+10 / −22 text lines

11local puk = require 'std.puk'
22local map = require 'std.map'
3local auto = require 'std.auto'
3puk.defer 'mini.splitjoin' ( function ( splitjoin )
4 splitjoin.setup()
5local treesj = puk 'treesj'
6local splitjoin = puk 'mini.splitjoin'
7
8treesj.setup {
9 use_default_keymaps = false,
10 max_join_length = 360,
11}
12splitjoin.setup()
14map.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 ()
2311 splitjoin.toggle()
24 end
25 end,
26}
12 end,
13 }
14end )

neovim/lua/bugabinga/terminal.lua

Modified

+78 / −14 text lines

1local puk = require 'std.puk'
21local map = require 'std.map'
2local user_command = require 'std.user_command'
4puk.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)
4local state = {
5 float = {
6 buffer = -1,
7 window = -1,
118 }
9}
13 map.normal.terminal {
14 description = 'Toggle terminal',
15 category = 'terminal',
16 keys = '<leader>tt',
17 command = neoterm.toggle,
11local 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,
1835 }
19end)
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 }
61end
63local 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
69end
71user_command.Terminal 'Toggle Terminal in floating window' (toggle_terminal)
72map.normal.terminal {
73 description = 'Toggle terminal',
74 category = 'terminal',
75 keys = '<F7>',
76 command = toggle_terminal,
77}
78map.terminal {
79 description = 'Enter normal mode',
80 category = 'terminal',
81 keys = '<esc><esc>',
82 command = '<c-\\><c-n>'
83}

neovim/lua/std/cheatsheet.lua

Added
new file mode 100644

+72 / −0 text lines

1local buffer_options = {
2 bufhidden = 'hide',
3 modifiable = false,
4 filetype = 'markdown', -- Alternative: use help ft
5}
6
7local window_border = 'shadow'
8
9local window_options = {
10 winblend = 42,
11}
13local 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
64end
66return setmetatable(
67 {
68 open = open,
69 },
70 {
72 })

neovim/lua/std/const.lua

Modified

+2 / −2 text lines

11local uname = vim.uv.os_uname()
2local win32 = vim.uv.os_uname().sysname:match 'Win' and true or false
3local wsl = vim.uv.os_uname().release:match 'WSL2' and true or false
2local win32 = uname.sysname:match 'Win' and true or false
3local wsl = uname.release:match 'WSL2' and true or false
55local os_background = function ()
66 -- Default value

neovim/lua/std/ignored.lua

Modified

+2 / −0 text lines

1010 'notify',
1111 'Glance',
1212 'nvim-docs-view',
13 'neo-tree',
14 'neo-tree-popup',
1315 'oil',
1416 'qf',
1517 'svn',

neovim/puk.nu

Modified

+11 / −2 text lines

140140 spec: record # a plugin to install
141141] {
142142 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' },
144144 codeberg => { 'https://codeberg.org/{repo}/archive/{commit}.tar.gz' },
145145 srht => { 'https://git.sr.ht/{repo}/archive/{commit}.tar.gz' },
146146 _ => { error make {
193193 _ => { error make { msg: 'unknown operating system' } },
195195let allowed_filetypes = [ lua vim scm txt $allowed_shared_lib_type ]
196let exclusions = [
197 **/tests/**,
198 **/test/**,
199 **/perf/**,
200 **/scripts/**,
201 **/fixtures/**,
202 **/scrapers/**,
203 **/spec/**,
204 **/target/release/deps/**
205]
197207def install-plugin [
198208 spec: record # a plugin to install
203213 try { rm --trash --recursive $plugin_path }
204214 mkdir $plugin_path
205215 cd $folder_path
206 let exclusions = [**/tests/**, **/scripts/**, **/fixtures/**, **/target/release/deps/**]
207216 glob $"**/*.{($allowed_filetypes | str join ',')}" --exclude $exclusions |
208217 path relative-to (pwd) |
209218 par-each { | file |

neovim/puk.plugins.nuon

Modified

+53 / −29 text lines

1212 github,
1313 neovim/nvim-lspconfig,
1414 master,
15 "47f236c058f0511702286a21ba53bbf42abbd8a8",
15 "040001d85e9190a904d0e35ef5774633e14d8475",
1616 null
1717 ],
1818 [
2020 github,
2121 nvim-treesitter/nvim-treesitter,
2222 main,
23 "75904bdff7da13cb54e05f53f25f25a924fe28a6",
23 "71bb6f603cd97674ac674e8c4e263ac0a1c50d6e",
2424 [
2525 nvim,
2626 --headless,
5252 github,
5353 "stevearc/oil.nvim",
5454 master,
55 "9a59256c8e88b29d2150e99b5960b2f111e51f75",
55 "dba037598843973b8c54bc5ce0318db4a0da439d",
5656 null
5757 ],
5858 [
6060 github,
6161 "Saghen/blink.cmp",
6262 main,
63 "765ee4cfb6d71e9d88a27f64f406251f3aa85fac",
63 "5a71e8e01f44084de9f7351f1e2bef74cdc0c450",
6464 [
6565 cargo,
6666 build,
7575 "9f0cb495f25bff32c936062d85046fbda0c43517",
7676 null
7777 ],
78 [
79 neoterm,
80 github,
81 "itmecho/neoterm.nvim",
82 main,
83 "23a780136892b1128485f20d772a771e528b651b",
84 null
85 ],
8678 [
8779 conform,
8880 github,
8981 "stevearc/conform.nvim",
9082 master,
91 "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8",
83 "f4e8837878fc5712d053ba3091a73d27d96a09e2",
9284 null
9385 ],
9486 [
9688 github,
9789 "j-hui/fidget.nvim",
9890 main,
99 "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f",
91 "9238947645ce17d96f30842e61ba81147185b657",
10092 null
10193 ],
10294 [
123115 "f34975103a38b3f608219a1324cdfc58ea660b8b",
124116 null
125117 ],
118 [
119 "mini.pairs",
120 github,
121 "echasnovski/mini.pairs",
122 main,
123 "7e834c5937d95364cc1740e20d673afe2d034cdb",
124 null
125 ],
126126 [
127127 "mini.clue",
128128 github,
144144 github,
145145 "echasnovski/mini.align",
146146 main,
147 "26111a737494bc39576ad67b52bbc2638ca23553",
147 "acf1ad6031e49553ed887a2a5e3603211346f1de",
148148 null
149149 ],
150150 [
168168 github,
169169 "echasnovski/mini.jump2d",
170170 main,
171 "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6",
171 "88077058297e80f1c76a18ed801ae9d7064187c6",
172172 null
173173 ],
174174 [
200200 github,
201201 "echasnovski/mini.icons",
202202 main,
203 "54686be7d58807906cb2c8c2216e0bf9c044f19a",
203 "44c0160526f7ae17ca8e8eab9ab235d047fcf7a6",
204204 null
205205 ],
206206 [
224224 github,
225225 mfussenegger/nvim-lint,
226226 master,
227 "6b46370d02cd001509a765591a3ffc481b538794",
228 null
229 ],
230 [
231 treesj,
232 github,
233 Wansmer/treesj,
234 main,
235 "03415ac60791d48e120a80d37e080744faf3ac15",
227 "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55",
236228 null
237229 ],
238230 [
264256 github,
265257 amrbashir/nvim-docs-view,
266258 master,
267 "365593534e0acd762bfddce6e8313315ffa4fa36",
259 "1b97f8f954d74c46061bf289b6cea9232484c12c",
268260 null
269261 ],
270262 [
272264 github,
273265 chrisgrieser/nvim-rulebook,
274266 main,
275 "e57a154b316a986a10d98f14acb2f822d0153029",
267 "7325802d4cfdcfd55a51c165290779bc835a0cd3",
276268 null
277269 ],
278270 [
288280 github,
289281 "folke/lazydev.nvim",
290282 main,
291 "f59bd14a852ca43db38e3662395354cb2a9b13e0",
283 "8620f82ee3f59ff2187647167b6b47387a13a018",
292284 null
293285 ],
294286 [
298290 main,
299291 "1518752906ba3fac0060d9efab6e4d3ec15d4b5a",
300292 null
293 ],
294 [
295 profile,
296 github,
297 "nvim-lua/plenary.nvim",
298 master,
299 "2d9b06177a975543726ce5c73fca176cedbffe9d",
300 null
301 ],
302 [
303 friendly-snippets,
304 github,
305 rafamadriz/friendly-snippets,
306 main,
307 "efff286dd74c22f731cdec26a70b46e5b203c619",
308 null
309 ],
310 [
311 tiny-inline-diagnostic,
312 github,
313 "rachartier/tiny-inline-diagnostic.nvim",
314 main,
315 "66d9166520a0cb3392a5ef68946fd3980d57383f",
316 null
317 ],
318 [
319 grug-far,
320 github,
321 "MagicDuck/grug-far.nvim",
322 main,
323 "11d0fbd6fff6f4e394af95319deeaab4ef88ce97",
324 null
301325 ]

neovim/skeleton/lua/plugin.lua

Added
new file mode 100644

+9 / −0 text lines

1return function()
2 return [[
3local puk = require 'std.puk'
4
5puk.defer'{{ NAME }}'(function({{ NAME }})
6 {{ CURSOR }}
7end)
8]]
9end

neovim/spell/nerd.utf-8.add

Modified

+9 / −0 text lines

134134Produktlandschaft
135135io
136136Log4J2
137Vorhand
138Rückhandbelag
139Vorhandbelag
140Fastarc
141Nittaku
142Griffform
143Noppen
144Tibhar
145Kopfgröße

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

Modified

Binary size (old → new): 1967 → 2095 bytes.

wezterm/bugabinga/code_fonts.csv

Modified

+1 / −1 text lines

68681,Monoid
69691,Monospace
70700,MonteCarlo Fixed 12
711,NanumGothic_Coding
710,NanumGothic_Coding
72720,NotCourierSans
73731,Office Code Pro
74741,Office Code Pro D

wezterm/bugabinga/launch.lua

Modified

+5 / −0 text lines

33return function ( cfg )
44 cfg.launch_menu = {
5 {
6 label = 'Upgrade',
7 args = { 'topgrade', },
8 cwd = wez.home_dir,
9 },
510 {
611 label = 'Editor',
712 args = { 'nvim', },

wezterm/wezterm.service

Modified

+1 / −1 text lines

66Restart=on-failure
88[Install]
9WantedBy=default.target
9WantedBy=graphical-session.target

zed/settings.json

Modified

+4 / −4 text lines

1010 "assistant": {
1111 "default_model": {
1212 "provider": "copilot_chat",
13 "model": "gpt-4o"
13 "model": "claude-3-5-sonnet"
1414 },
1515 "version": "2"
1616 },
1717 "features": {
1818 "copilot": false
1919 },
20 "theme": "Oxocarbon Dark (IBM Carbon)",
20 "theme": "Serendipity Midnight",
2121 "vim_mode": true,
2222 "vim": {
2323 "use_smartcase_find": true,
2626 "ui_font_size": 16,
2727 "ui_font_family": "Intel One Mono",
2828 "unstable.ui_density": "comfortable",
29 "buffer_font_family": "Cousine",
29 "buffer_font_family": "Monaspace Krypton Var",
3030 "buffer_line_height": "comfortable",
31 "buffer_font_size": 24,
31 "buffer_font_size": 18,
3232 "cursor_blink": false,
3333 "show_whitespaces": "selection",
3434 "show_completions_on_input": false,