repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

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

b0aad71af1b7fbd73228cd203e13e62dafa98517

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (9)

+100 / −116 text lines

Diff layout

neovim/.luarc.jsonc

Deleted
deleted file mode 100644

+0 / −21 text lines

1{
2 "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3 "diagnostics": {
4 "globals": [
5 "vim"
6 ],
7 "neededFileStatus": {
8 "codestyle-check": "Any"
9 }
10 },
11 "workspace": {
12 "checkThirdParty": false
13 },
14 "runtime": {
15 "version": "LuaJIT",
16 "pathStrict": true,
17 "special": {
18 "want": "require"
19 }
20 }
21}

neovim/lazy-lock.json

Modified

+1 / −0 text lines

1515 "hyper.nvim": { "branch": "main", "commit": "b84fb39e703b1dd487d20c4faf028ee51374c88b" },
1616 "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
1717 "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
18 "lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
1819 "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" },
1920 "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
2021 "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" },

neovim/lua/bugabinga/lsp/clients/lua.lua

Modified

+1 / −1 text lines

1111 settings = {
1212 Lua = {
1313 addonManager = { enable = false, },
14 completion = { callSnippet = 'Disable', postfix = '.', },
14 completion = { callSnippet = 'Replace', },
1515 diagnostics = { globals = { 'vim', }, workspaceRate = 50, },
1616 hint = { enable = true, setType = true, },
1717 telemetry = { enable = false, },

neovim/lua/bugabinga/lsp/init.lua

Modified

+24 / −14 text lines

193193local old_tagfunc
195195local keybinds = {}
196local add = function ( client_id, keybind )
196local add = function ( client_id, keybind_remover )
197 vim.validate {
198 client_id = { client_id, 'number', },
199 keybind_remover = { keybind_remover, 'function', },
200 }
197201 if not table.contains( keybinds, client_id ) then
198202 keybinds[client_id] = {}
199203 end
200 table.insert( keybinds[client_id], keybind )
204 table.insert( keybinds[client_id], keybind_remover )
201205end
203207local lsp_attach = function ( args )
204208 local bufnr = args.buf
205 local client = vim.lsp.get_client_by_id( args.data.client_id )
209 local client_id = args.data.client_id
210 local client = vim.lsp.get_client_by_id( client_id )
206211 if not client then return end
208213 debug.print( client.server_capabilities )
237242 end
238243 end
245 local lsp_signature_ok, lsp_signature = pcall( require, 'lsp_signature' )
246 if lsp_signature_ok then
247 lsp_signature.on_attach( {}, bufnr )
248 end
240250 if client.server_capabilities.documentHighlightProvider then
241251 -- the timer has application lifetime. no need to close
242252 local delay = 300
260270 end
262272 if client.server_capabilities.inlayHintProvider then
263 add( map.normal {
273 add( client_id, map.normal {
264274 description = 'Toggle inlay hints',
265275 category = 'lsp',
266276 buffer = bufnr,
267277 keys = '<leader>ti',
268278 command = function ()
269 vim.lsp.inlay_hint( bufnr, nil )
279 vim.lsp.inlay_hint.enable( bufnr, nil )
270280 end,
271281 } )
272282 end
274 add( map.normal {
284 add( client_id, map.normal {
275285 description = 'Show hover documentation above cursor.',
276286 category = 'lsp',
277287 buffer = bufnr,
279289 command = vim.lsp.buf.hover,
280290 } )
282 add( map.normal {
292 add( client_id, map.normal {
283293 description = 'Show signature help under cursor.',
284294 category = 'lsp',
285295 buffer = bufnr,
287297 command = vim.lsp.buf.signature_help,
288298 } )
290 add( map.normal {
300 add( client_id, map.normal {
291301 description = 'Show available code actions on current line.',
292302 category = 'lsp',
293303 buffer = bufnr,
295305 command = vim.lsp.buf.code_action,
296306 } )
298 add( map.normal {
308 add( client_id, map.normal {
299309 description = 'Goto to definition of symbol under cursor.',
300310 category = 'lsp',
301311 buffer = bufnr,
303313 command = vim.lsp.buf.definition,
304314 } )
306 add( map.normal {
316 add( client_id, map.normal {
307317 description = 'Show implementations of symbol under cursor.',
308318 category = 'lsp',
309319 buffer = bufnr,
311321 command = vim.lsp.buf.implementation,
312322 } )
314 add( map.normal {
324 add( client_id, map.normal {
315325 description = 'Show incoming calls of symbol under cursor.',
316326 category = 'lsp',
317327 buffer = bufnr,
319329 command = vim.lsp.buf.incoming_calls,
320330 } )
322 add( map.normal {
332 add( client_id, map.normal {
323333 description = 'Show outgoing calls of symbol under cursor.',
324334 category = 'lsp',
325335 buffer = bufnr,
327337 command = vim.lsp.buf.outgoing_calls,
328338 } )
330 add( map.normal {
340 add( client_id, map.normal {
331341 description = 'Show references of symbol under cursor.',
332342 category = 'lsp',
333343 buffer = bufnr,
335345 command = vim.lsp.buf.references,
336346 } )
338 add( map.normal {
348 add( client_id, map.normal {
339349 description = 'Rename symbol under cursor.',
340350 category = 'lsp',
341351 buffer = bufnr,

neovim/lua/bugabinga/nugu/init.lua

Modified

+3 / −3 text lines

204204_.Define = _.PreProc
205205_.Macro = _.PreProc
206206_.PreCondit = _.PreProc
207_.Parameter { fg = content_focus, }
208209_.Type = _.Statement
209210_.StorageClass = _.Statement
276277_['@function'] = _.Function
277278_['@function.builtin'] = _.Special
278279_['@function.macro'] = _.Macro
279_['@parameter'] = _.Identifier
280_['@parameter'] = _.Parameter
280281_['@method'] = _.Function
281282_['@field'] = _.Identifier
282283_['@property'] = _.Identifier
293294_['@type.definition'] = _.Typedef
294295_['@storageclass'] = _.StorageClass
295296_['@structure'] = _.Structure
296_['@namespace'] = _.Identifier
297_['@namespace'] = _.PreProc
297298_['@include'] = _.Include
298299_['@preproc'] = _.PreProc
299300_['@debug'] = _.Debug
518519_.IblWhitespace = _.Whitespace
519520_.IblScope { fg = ui_focus, bg = _.Normal.bg, }
521_.Hlargs { fg = content_important_local, }
523523_.MiniStarterCurrent { fg = ui_normal, bg = ui_accent, }
524524_.MiniStarterFooter = _.Keyword

neovim/lua/bugabinga/plugins/hlargs.lua

Deleted
deleted file mode 100644

+0 / −21 text lines

1return {
2 'm-demare/hlargs.nvim',
3 event = { 'BufRead', 'BufLeave', 'BufEnter', 'SessionLoadPost', },
4 opts = {
5 -- highlight = { 'Hlargs', },
6 paint_arg_declarations = true,
7 paint_arg_usages = true,
8 paint_catch_blocks = {
9 declarations = true,
10 usages = true,
11 },
12 extras = { named_parameter = true, },
13 excluded_argnames = {
14 declarations = {},
15 usages = { lua = {}, },
16 },
17 },
18 dependencies = {
19 'nvim-treesitter/nvim-treesitter',
20 },
21}

neovim/lua/bugabinga/plugins/lsp_signature.lua

Added
new file mode 100644

+10 / −0 text lines

1return {
2 'ray-x/lsp_signature.nvim',
3 event = 'VeryLazy',
4 opts = {
5 debug = require 'std.debug'.get(),
6 -- floating_window_off_x = 10,
7 -- floating_window_off_y = -2,
8 -- handler_opts = { border = vim.g.border_style, },
9 },
10}

neovim/lua/bugabinga/plugins/neodev.lua

Modified

+1 / −0 text lines

11return {
22 'folke/neodev.nvim',
3 lazy = false,
34 opts = {
45 lspconfig = false,
56 override = function ( root_dir, library )

neovim/lua/std/project.lua

Modified

+60 / −56 text lines

1111local markers_to_string = function ( markers )
1212 return vim.inspect( markers )
1313end
14local create_hash = function ( path, markers )
14local create_hash = function ( path, markers, stop )
1515 local path_hash = hasher( path )
16 local stop_hash = hasher( stop )
1617 local markers_hash = hasher( markers_to_string( markers ) )
17 local hash = path_hash .. '|' .. markers_hash
18 local hash = path_hash .. '|' .. markers_hash .. '|' .. stop_hash
1819 return hash
1920end
20local cache_get = function ( path, markers )
21 local hash = create_hash( path, markers )
21local cache_get = function ( path, markers, stop )
22 local hash = create_hash( path, markers, stop )
2223 local hit = cache[hash]
2324 return hit
2425end
25local cache_set = function ( project_root, path, markers )
26 local hash = create_hash( path, markers )
26local cache_set = function ( project_root, path, markers, stop )
27 local hash = create_hash( path, markers, stop )
2728 cache[hash] = project_root
2829end
3536--- the weight of a project marker, when the likelyhood is low
3637local MAYBE = 1
3738--- the weight of a project marker, when the likelyhood is high
38local LIKELY = 2
39local LIKELY = 3
3940--- the weight of a project marker, when the likelyhood is 100%
40local DEFINITLY = 3
41local DEFINITLY = 7
4243--- Determines the path to a root directory, starting from the given path.
4344-- Markers have a name and weight.
5657-- local project = require'std.project'
5758-- local current_buffer = vim.api.nvim_buf_get_name(0)
5859-- local markers = {
59-- { name = ".git", weight = MAYEB },
60-- { name = ".git", weight = MAYBE },
6061-- { name = "README", weight = LIKELY },
6162-- { naem = "Makefile", weight = DEFINITLY },
6263-- }
8687 if #path == 0 then return nil end
88 local cache_hit = cache_get( path, markers )
89 local cache_hit = cache_get( path, markers, stop )
8990 if cache_hit then
9091 debug.print( 'CACHE HIT', cache_hit )
9192 return cache_hit
135136 local project_root = nil
136137 local max_likelyhood = 0
137138 -- the project root is most likely the directory with the highest marker count
138 -- and highest distance to current buffer.
139 -- because if there are markers further away from the buffer than other markers,
140 -- then it is most likely a nested project structure (multi-module).
139 -- and closest distance to current buffer.
140 -- however, if there are markers further away from the buffer than other markers,
141 -- then it could be a nested project structure (multi-module).
141142 -- in those cases we are looking for the root project folder, instead the nearest
142143 -- child project root folder.
143144 for _, score in ipairs( directory_scores ) do
144 local likelihood = score.marker_count + score.distance_to_buffer_file
145 if likelihood > max_likelyhood then
146 max_likelyhood = likelihood
145 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 = likelyhood
147149 project_root = score.path
148150 end
149151 end
150152 if project_root then
151 cache_set( project_root, path, markers )
153 cache_set( project_root, path, markers, stop )
152154 end
155 debug.print( 'found project root', project_root, directory_scores )
153156 return project_root
154157end
162165local function find_project_root( path, markers )
163166 -- define some language-independent markers
164167 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, },
181184 }
183186 markers = markers or {}
205208 { name = 'gradlew', weight = DEFINITLY, },
206209 { name = 'gradlew.bat', weight = DEFINITLY, },
207210 }
208 return find_root( path, java_markers )
211 return find_project_root( path, java_markers )
209212end
211local 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, },
221}
223214local 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, },
225 }
227 return find_project_root( path, lua_markers )
225228end
227local 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, },
232}
234230local 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, },
236 }
238 --FIXME: can we ask the zig build system for this info?
239 return find_project_root( path, zig_markers )
236240end
238242local find_rust_project_root = function ( path )
239243 local markers = {
240244 { name = 'Cargo.toml', weight = DEFINITLY, },
241245 }
242 local cargo_crate_dir = find_root( path, markers )
246 local cargo_crate_dir = find_project_root( path, markers )
243247 if cargo_crate_dir == nil then return nil end
245249 local cmd = {