dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide CI runs Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
b0aad71af1b7fbd73228cd203e13e62dafa98517
Oliver Jan Krylow <oliver@bugabinga.net > · 19 Mar 2024
unsigned
Browse files Compare with HEAD
Changed files (9) Diff layout Auto Unified Split
neovim/.luarc.jsonc Deleted deleted file mode 100644+0 / −21 text lines
2 - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",8 - "codestyle-check": "Any"12 - "checkThirdParty": false
neovim/lazy-lock.json Modified +1 / −0 text lines
15 15 "hyper.nvim" : { "branch" : "main" , "commit" : "b84fb39e703b1dd487d20c4faf028ee51374c88b" }, "hyper.nvim" : { "branch" : "main" , "commit" : "b84fb39e703b1dd487d20c4faf028ee51374c88b" },16 16 "indent-blankline.nvim" : { "branch" : "master" , "commit" : "3d08501caef2329aba5121b753e903904088f7e6" }, "indent-blankline.nvim" : { "branch" : "master" , "commit" : "3d08501caef2329aba5121b753e903904088f7e6" },17 17 "lazy.nvim" : { "branch" : "main" , "commit" : "83493db50a434a4c5c648faf41e2ead80f96e478" }, "lazy.nvim" : { "branch" : "main" , "commit" : "83493db50a434a4c5c648faf41e2ead80f96e478" },
18 + "lsp_signature.nvim" : { "branch" : "master" , "commit" : "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },18 19 "mason-tool-installer.nvim" : { "branch" : "main" , "commit" : "1212fb6082b7177dde17ea65e429e027835aeb40" }, "mason-tool-installer.nvim" : { "branch" : "main" , "commit" : "1212fb6082b7177dde17ea65e429e027835aeb40" },19 20 "mason.nvim" : { "branch" : "main" , "commit" : "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mason.nvim" : { "branch" : "main" , "commit" : "3b5068f0fc565f337d67a2d315d935f574848ee7" },20 21 "mini.align" : { "branch" : "main" , "commit" : "f845218c5fea89e49074e48270dc5e1b9511a0f9" }, "mini.align" : { "branch" : "main" , "commit" : "f845218c5fea89e49074e48270dc5e1b9511a0f9" },neovim/lua/bugabinga/lsp/clients/lua.lua Modified +1 / −1 text lines
11 11 settings = { settings = {13 13 addonManager = { enable = false , }, addonManager = { enable = false , },14 - completion = { callSnippet = 'Disable' , postfix = '.' , },14 + completion = { callSnippet = 'Replace' , },15 15 diagnostics = { globals = { 'vim' , }, workspaceRate = 50 , }, diagnostics = { globals = { 'vim' , }, workspaceRate = 50 , },16 16 hint = { enable = true , setType = true , }, hint = { enable = true , setType = true , },17 17 telemetry = { enable = false , }, telemetry = { enable = false , },neovim/lua/bugabinga/lsp/init.lua Modified +24 / −14 text lines
193 193 local old_tagfunclocal old_tagfunc195 195 local keybinds = {}local keybinds = {}196 - local add = function ( client_id, keybind )196 + local add = function ( client_id, keybind_remover )198 + client_id = { client_id, 'number' , },199 + keybind_remover = { keybind_remover, 'function' , },197 201 if not table .contains( keybinds, client_id ) then if not table .contains( keybinds, client_id ) then 198 202 keybinds[client_id] = {} keybinds[client_id] = {}200 - table .insert ( keybinds[client_id], keybind )204 + table .insert ( keybinds[client_id], keybind_remover )203 207 local lsp_attach = function ( args )local lsp_attach = function ( args )204 208 local bufnr = args.buf local bufnr = args.buf205 - local client = vim.lsp.get_client_by_id( args . data . client_id )209 + local client_id = args.data.client_id210 + local client = vim.lsp.get_client_by_id( client_id )206 211 if not client then return end if not client then return end 208 213 debug .print( client.server_capabilities ) debug .print( client.server_capabilities )
245 + local lsp_signature_ok, lsp_signature = pcall ( require , 'lsp_signature' )246 + if lsp_signature_ok then 247 + lsp_signature.on_attach( {}, bufnr )240 250 if client.server_capabilities.documentHighlightProvider then if client.server_capabilities.documentHighlightProvider then 242 252 local delay = 300 local delay = 300 262 272 if client.server_capabilities.inlayHintProvider then if client.server_capabilities.inlayHintProvider then 273 + add( client_id , map.normal {264 274 description = 'Toggle inlay hints' , description = 'Toggle inlay hints' ,265 275 category = 'lsp' , category = 'lsp' ,266 276 buffer = bufnr, buffer = bufnr,267 277 keys = '<leader>ti' , keys = '<leader>ti' ,268 278 command = function () command = function ()269 - vim.lsp.inlay_hint( bufnr, nil )279 + vim.lsp.inlay_hint. enable ( bufnr, nil )284 + add( client_id , map.normal {275 285 description = 'Show hover documentation above cursor.' , description = 'Show hover documentation above cursor.' ,276 286 category = 'lsp' , category = 'lsp' ,277 287 buffer = bufnr, buffer = bufnr,279 289 command = vim.lsp.buf.hover, command = vim.lsp.buf.hover,292 + add( client_id , map.normal {283 293 description = 'Show signature help under cursor.' , description = 'Show signature help under cursor.' ,284 294 category = 'lsp' , category = 'lsp' ,285 295 buffer = bufnr, buffer = bufnr,287 297 command = vim.lsp.buf.signature_help, command = vim.lsp.buf.signature_help,300 + add( client_id , map.normal {291 301 description = 'Show available code actions on current line.' , description = 'Show available code actions on current line.' ,292 302 category = 'lsp' , category = 'lsp' ,293 303 buffer = bufnr, buffer = bufnr,295 305 command = vim.lsp.buf.code_action, command = vim.lsp.buf.code_action,308 + add( client_id , map.normal {299 309 description = 'Goto to definition of symbol under cursor.' , description = 'Goto to definition of symbol under cursor.' ,300 310 category = 'lsp' , category = 'lsp' ,301 311 buffer = bufnr, buffer = bufnr,303 313 command = vim.lsp.buf.definition, command = vim.lsp.buf.definition,316 + add( client_id , map.normal {307 317 description = 'Show implementations of symbol under cursor.' , description = 'Show implementations of symbol under cursor.' ,308 318 category = 'lsp' , category = 'lsp' ,309 319 buffer = bufnr, buffer = bufnr,311 321 command = vim.lsp.buf.implementation, command = vim.lsp.buf.implementation,324 + add( client_id , map.normal {315 325 description = 'Show incoming calls of symbol under cursor.' , description = 'Show incoming calls of symbol under cursor.' ,316 326 category = 'lsp' , category = 'lsp' ,317 327 buffer = bufnr, buffer = bufnr,319 329 command = vim.lsp.buf.incoming_calls, command = vim.lsp.buf.incoming_calls,332 + add( client_id , map.normal {323 333 description = 'Show outgoing calls of symbol under cursor.' , description = 'Show outgoing calls of symbol under cursor.' ,324 334 category = 'lsp' , category = 'lsp' ,325 335 buffer = bufnr, buffer = bufnr,327 337 command = vim.lsp.buf.outgoing_calls, command = vim.lsp.buf.outgoing_calls,340 + add( client_id , map.normal {331 341 description = 'Show references of symbol under cursor.' , description = 'Show references of symbol under cursor.' ,332 342 category = 'lsp' , category = 'lsp' ,333 343 buffer = bufnr, buffer = bufnr,335 345 command = vim.lsp.buf.references, command = vim.lsp.buf.references,348 + add( client_id , map.normal {339 349 description = 'Rename symbol under cursor.' , description = 'Rename symbol under cursor.' ,340 350 category = 'lsp' , category = 'lsp' ,341 351 buffer = bufnr, buffer = bufnr,neovim/lua/bugabinga/nugu/init.lua Modified +3 / −3 text lines
204 204 _.Define = _.PreProc_.Define = _.PreProc205 205 _.Macro = _.PreProc_.Macro = _.PreProc206 206 _.PreCondit = _.PreProc_.PreCondit = _.PreProc
207 + _.Parameter { fg = content_focus, }208 209 _.Type = _.Statement_.Type = _.Statement209 210 _.StorageClass = _.Statement_.StorageClass = _.Statement276 277 _['@function' ] = _.Function_['@function' ] = _.Function277 278 _['@function.builtin' ] = _.Special_['@function.builtin' ] = _.Special278 279 _['@function.macro' ] = _.Macro_['@function.macro' ] = _.Macro279 - _['@parameter' ] = _.Identifier280 + _['@parameter' ] = _.Parameter280 281 _['@method' ] = _.Function_['@method' ] = _.Function281 282 _['@field' ] = _.Identifier_['@field' ] = _.Identifier282 283 _['@property' ] = _.Identifier_['@property' ] = _.Identifier293 294 _['@type.definition' ] = _.Typedef_['@type.definition' ] = _.Typedef294 295 _['@storageclass' ] = _.StorageClass_['@storageclass' ] = _.StorageClass295 296 _['@structure' ] = _.Structure_['@structure' ] = _.Structure296 - _['@namespace' ] = _.Identifier297 + _['@namespace' ] = _.PreProc297 298 _['@include' ] = _.Include_['@include' ] = _.Include298 299 _['@preproc' ] = _.PreProc_['@preproc' ] = _.PreProc299 300 _['@debug' ] = _.Debug_['@debug' ] = _.Debug518 519 _.IblWhitespace = _.Whitespace_.IblWhitespace = _.Whitespace519 520 _.IblScope { fg = ui_focus, bg = _.Normal.bg, }_.IblScope { fg = ui_focus, bg = _.Normal.bg, }521 - _.Hlargs { fg = content_important_local, }
523 523 _.MiniStarterCurrent { fg = ui_normal, bg = ui_accent, }_.MiniStarterCurrent { fg = ui_normal, bg = ui_accent, }524 524 _.MiniStarterFooter = _.Keyword_.MiniStarterFooter = _.Keywordneovim/lua/bugabinga/plugins/hlargs.lua Deleted deleted file mode 100644+0 / −21 text lines
2 - 'm-demare/hlargs.nvim' ,3 - event = { 'BufRead' , 'BufLeave' , 'BufEnter' , 'SessionLoadPost' , },6 - paint_arg_declarations = true ,7 - paint_arg_usages = true ,8 - paint_catch_blocks = {12 - extras = { named_parameter = true , },13 - excluded_argnames = {15 - usages = { lua = {}, },19 - 'nvim-treesitter/nvim-treesitter' ,
neovim/lua/bugabinga/plugins/lsp_signature.lua Added new file mode 100644+10 / −0 text lines
2 + 'ray-x/lsp_signature.nvim' ,5 + debug = require 'std.debug' .get(),neovim/lua/bugabinga/plugins/neodev.lua Modified +1 / −0 text lines
2 2 'folke/neodev.nvim' , 'folke/neodev.nvim' ,4 5 lspconfig = false , lspconfig = false ,5 6 override = function ( root_dir, library ) override = function ( root_dir, library )neovim/lua/std/project.lua Modified +60 / −56 text lines
11 11 local markers_to_string = function ( markers )local markers_to_string = function ( markers )12 12 return vim.inspect( markers ) return vim.inspect( markers )14 - local create_hash = function ( path, markers )14 + local create_hash = function ( path, markers, stop )15 15 local path_hash = hasher( path ) local path_hash = hasher( path )
16 + local stop_hash = hasher( stop )16 17 local markers_hash = hasher( markers_to_string( markers ) ) local markers_hash = hasher( markers_to_string( markers ) )17 - local hash = path_hash .. '|' .. markers_hash18 + local hash = path_hash .. '|' .. markers_hash .. ' | ' .. stop_hash 18 19 return hash return hash20 - local cache_get = function ( path, markers )21 - local hash = create_hash( path, markers )21 + local cache_get = function ( path, markers, stop )22 + local hash = create_hash( path, markers, stop )22 23 local hit = cache[hash] local hit = cache[hash]23 24 return hit return hit25 - local cache_set = function ( project_root, path, markers )26 - local hash = create_hash( path, markers )26 + local cache_set = function ( project_root, path, markers, stop )27 + local hash = create_hash( path, markers, stop )27 28 cache[hash] = project_root cache[hash] = project_root36 37 local MAYBE = 1 local MAYBE = 1 86 87 if # path == 0 then return nil end if # path == 0 then return nil end 88 - local cache_hit = cache_get( path, markers )89 + local cache_hit = cache_get( path, markers, stop )89 90 if cache_hit then if cache_hit then 90 91 debug .print( 'CACHE HIT' , cache_hit ) debug .print( 'CACHE HIT' , cache_hit )91 92 return cache_hit return cache_hit135 136 local project_root = nil local project_root = nil 136 137 local max_likelyhood = 0 local max_likelyhood = 0 143 144 for _, score in ipairs ( directory_scores ) do for _, score in ipairs ( directory_scores ) do 144 - local likelihood = score.marker_count + score.distance_to_buffer_file145 - if likelihood > max_likelyhood then 146 - max_likelyhood = likelihood145 + local likelyhood = score.marker_count * ( 1 / score.distance_to_buffer_file) 146 + if debug .get() then score.likelyhood = likelyhood end 147 + if likelyhood > max_likelyhood then 148 + max_likelyhood = likelyhood147 149 project_root = score.path project_root = score.path150 152 if project_root then if project_root then 151 - cache_set( project_root, path, markers )153 + cache_set( project_root, path, markers, stop )
155 + debug .print( 'found project root' , project_root, directory_scores )153 156 return project_root return project_root162 165 local function find_project_root ( path, markers )local function find_project_root ( path, markers )164 167 local default_markers = { local default_markers = {165 - { name = '.git' , weight = LIKELY, },166 - { name = '.gitignore' , weight = LIKELY, },167 - { name = '.svn' , weight = LIKELY, },168 - { name = 'justfile' , weight = LIKELY, },169 - { name = 'Jenkinsfile' , weight = MAYBE, },170 - { name = '.editorconfig' , weight = MAYBE, },171 - { name = 'LICENSE' , weight = MAYBE, },172 - { name = 'LICENSE.md' , weight = MAYBE, },173 - { name = 'LICENSE.txt' , weight = MAYBE, },174 - { name = 'COPYING' , weight = MAYBE, },175 - { name = 'README' , weight = MAYBE, },176 - { name = 'README.md' , weight = MAYBE, },177 - { name = 'Makefile' , weight = LIKELY, },178 - { name = 'flake.nix' , weight = MAYBE, },179 - { name = 'flake.nix' , weight = MAYBE, },180 - { name = '.project_model' , weight = DEFINITLY, },168 + { name = '.git' , weight = LIKELY, },169 + { name = '.gitignore' , weight = LIKELY, },170 + { name = '.svn' , weight = LIKELY, },171 + { name = 'justfile' , weight = LIKELY, },172 + { name = 'Jenkinsfile' , weight = MAYBE, },173 + { name = '.editorconfig' , weight = MAYBE, },174 + { name = 'LICENSE' , weight = MAYBE, },175 + { name = 'LICENSE.md' , weight = MAYBE, },176 + { name = 'LICENSE.txt' , weight = MAYBE, },177 + { name = 'COPYING' , weight = MAYBE, },178 + { name = 'README' , weight = MAYBE, },179 + { name = 'README.md' , weight = MAYBE, },180 + { name = 'Makefile' , weight = LIKELY, },181 + { name = 'flake.nix' , weight = MAYBE, },182 + { name = 'flake.nix' , weight = MAYBE, },183 + { name = '.project_model.lua' , weight = DEFINITLY, },183 186 markers = markers or {} markers = markers or {}205 208 { name = 'gradlew' , weight = DEFINITLY, }, { name = 'gradlew' , weight = DEFINITLY, },206 209 { name = 'gradlew.bat' , weight = DEFINITLY, }, { name = 'gradlew.bat' , weight = DEFINITLY, },208 - return find_root ( path, java_markers )211 + return find_project_root ( path, java_markers )211 - local lua_markers = {212 - { name = '.luarc.json' , weight = MAYBE, },213 - { name = '.luarc.jsonc' , weight = MAYBE, },214 - { name = '.luacheckrc' , weight = MAYBE, },215 - { name = '.stylua.toml' , weight = MAYBE, },216 - { name = 'stylua.toml' , weight = MAYBE, },217 - { name = 'selene.toml' , weight = MAYBE, },218 - { name = 'selene.yml' , weight = MAYBE, },219 - { name = 'neovim.yml' , weight = MAYBE, },220 - { name = 'lua' , weight = MAYBE, },
223 214 local find_lua_project_root = function ( path )local find_lua_project_root = function ( path )224 - return find_root( path, lua_markers )215 + local lua_markers = {216 + { name = '.luarc.json' , weight = MAYBE, },217 + { name = '.luarc.jsonc' , weight = MAYBE, },218 + { name = '.luacheckrc' , weight = MAYBE, },219 + { name = '.stylua.toml' , weight = MAYBE, },220 + { name = 'stylua.toml' , weight = MAYBE, },221 + { name = 'selene.toml' , weight = MAYBE, },222 + { name = 'selene.yml' , weight = MAYBE, },223 + { name = 'neovim.yml' , weight = MAYBE, },224 + { name = 'lua' , weight = MAYBE, },227 + return find_project_root( path, lua_markers )227 - local zig_markers = {228 - { name = 'build.zig' , weight = DEFINITLY, },229 - { name = 'zls.build.json' , weight = DEFINITLY, },230 - { name = 'zig-cache' , weight = MAYBE, },231 - { name = 'zig-out' , weight = MAYBE, },
234 230 local find_zig_project_root = function ( path )local find_zig_project_root = function ( path )235 - return find_root( path, zig_markers )231 + local zig_markers = {232 + { name = 'build.zig' , weight = DEFINITLY, },233 + { name = 'zls.build.json' , weight = DEFINITLY, },234 + { name = 'zig-cache' , weight = MAYBE, },235 + { name = 'zig-out' , weight = MAYBE, },239 + return find_project_root( path, zig_markers )238 242 local find_rust_project_root = function ( path )local find_rust_project_root = function ( path )239 243 local markers = { local markers = {240 244 { name = 'Cargo.toml' , weight = DEFINITLY, }, { name = 'Cargo.toml' , weight = DEFINITLY, },242 - local cargo_crate_dir = find_root ( path, markers )246 + local cargo_crate_dir = find_project_root ( path, markers )243 247 if cargo_crate_dir == nil then return nil end if cargo_crate_dir == nil then return nil end 245 249 local cmd = { local cmd = {