repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: adds lsp keybinds

f2343112f82555b756adbae15de94e6c10b85d26

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (31)

+536 / −159 text lines · 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

+3 / −1 text lines

99-- ▀ ▀
1111-- Setup debug mode
12vim.g.bugabinga_debug_mode = true
12vim.g.bugabinga_debug_mode = false
1414local start_time = vim.uv.hrtime()
1515local auto = require 'std.auto'
6363require 'bugabinga.textobjects'
6464require 'bugabinga.key_preview'
6565require 'bugabinga.patterns'
66require 'bugabinga.pairs'
6667require 'bugabinga.terminal'
68require 'bugabinga.tree_view'
6870require '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/incubator.lua

Modified

+6 / −6 text lines

2828-------------------------------------------------------------------------------
2929--- this is pretty great! i just need better binds and tell which key about them
3030puk.defer 'rulebook' (function(rulebook)
31 rulebook.setup ()
31 rulebook.setup()
3232 map.normal {
3333 description = 'ignore rule',
3434 category = 'lint',
5656end)
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',
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 }
9898end)

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/splitjoin.lua

Modified

+10 / −1 text lines

99 use_default_keymaps = false,
1010 max_join_length = 360,
12splitjoin.setup()
13splitjoin.setup {
14 -- Module mappings. Use `''` (empty string) to disable one.
15 -- Created for both Normal and Visual modes.
16 mappings = {
17 toggle = '',
18 split = '',
19 join = '',
20 },
21}
1423map.normal {
1524 description = 'Toggle Tree Join/Split',

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/bugabinga/tree_view.lua

Added
new file mode 100644

+35 / −0 text lines

1local puk = require 'std.puk'
2local map = require 'std.map'
3
4puk.defer 'neo-tree' (function(neotree)
5 vim.cmd.packadd 'plenary'
6 vim.cmd.packadd 'nui'
7 neotree.setup {
8 close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
9 popup_border_style = vim.g.border_style,
10 filesystem = {
11 filtered_items = {
12 visible = true,
13 },
14 follow_current_file = {
15 enabled = true, -- This will find and focus the file in the active buffer every time
16 -- the current file is changed while the tree is open.
17 },
18 group_empty_dirs = true, -- when true, empty folders will be grouped together
19 hijack_netrw_behavior = "disabled", -- netrw disabled, opening a directory opens neo-tree
20 -- in whatever position is specified in window.position
21 -- "open_current", -- netrw disabled, opening a directory opens within the
22 -- window like netrw would, regardless of window.position
23 -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
24 use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
25 -- instead of relying on nvim autocmd events.
26 },
27 }
29 map.normal {
30 description = "Toggle tree view",
31 keys = "<leader>e",
32 category = "tree",
33 command = '<cmd>Neotree reveal<cr>',
34 }
35end)

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/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

+10 / −1 text lines

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 / −21 text lines

1212 github,
1313 neovim/nvim-lspconfig,
1414 master,
15 "47f236c058f0511702286a21ba53bbf42abbd8a8",
15 "9f2c279cf9abe584f03bfeb37c6658d68e3ff49d",
1616 null
1717 ],
1818 [
2020 github,
2121 nvim-treesitter/nvim-treesitter,
2222 main,
23 "75904bdff7da13cb54e05f53f25f25a924fe28a6",
23 "67e40d570e4eb3f3ded89f9378c8cb00c0df12db",
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 "46eb5f3fd3dba0a3bb3d026fb2b7462f4a0656b7",
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 [
232232 github,
233233 Wansmer/treesj,
234234 main,
235 "03415ac60791d48e120a80d37e080744faf3ac15",
235 "94f6df623f2d15630b1b617abff39962024cb501",
236236 null
237237 ],
238238 [
264264 github,
265265 amrbashir/nvim-docs-view,
266266 master,
267 "365593534e0acd762bfddce6e8313315ffa4fa36",
267 "1b97f8f954d74c46061bf289b6cea9232484c12c",
268268 null
269269 ],
270270 [
272272 github,
273273 chrisgrieser/nvim-rulebook,
274274 main,
275 "e57a154b316a986a10d98f14acb2f822d0153029",
275 "7325802d4cfdcfd55a51c165290779bc835a0cd3",
276276 null
277277 ],
278278 [
298298 main,
299299 "1518752906ba3fac0060d9efab6e4d3ec15d4b5a",
300300 null
301 ],
302 [
303 plenary,
304 github,
305 "nvim-lua/plenary.nvim",
306 master,
307 "2d9b06177a975543726ce5c73fca176cedbffe9d",
308 null
309 ],
310 [
311 nui,
312 github,
313 "MunifTanjim/nui.nvim",
314 main,
315 "53e907ffe5eedebdca1cd503b00aa8692068ca46",
316 null
317 ],
318 [
319 neo-tree,
320 github,
321 "nvim-neo-tree/neo-tree.nvim",
322 main,
323 "d7266e467de1adbaf775cbd4bff9b68842e27386",
324 null
325 ],
326 [
327 friendly-snippets,
328 github,
329 rafamadriz/friendly-snippets,
330 main,
331 "efff286dd74c22f731cdec26a70b46e5b203c619",
332 null
301333 ]
302]
334]No final newline

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/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,