repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: renamed std.debug to std.dbg

5ea834118b9cb1d6af67fc62cff5ba2f0cb32712

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

prevents confusion with builtin module `debug`.

Changed files (23)

neovim/.lsp.settings.lua

Modified
2 2 return {
3 3 LuaLS = {
4 4 Lua = {
5 5 diagnostics = { globals = { 'vim', 'prequire', }, },
6 + runtime = { version = 'LuaJIT', },

neovim/README.md

Modified
32 32 # todo
34 +* toggling case conventions
34 35 * Move to treesitter main branch
35 36 * check out `vim.snippet`
36 37 * use `vim.base64` in wezterm plugin
37 38 * Bug: LuaLS is getting crazy diagnosing non-stop...
38 39 * integrate language tool?
39 40 * ]s [s to jump to spelling mistakes
41 +* learn marks and refactor mark.lua
40 42 * try Termdebug with gdb
41 43 * adapt config to respect `vim.g.nerdfont` (std.constants?)
42 44 * use ltex-ls for markdown, code comments and commit messages
43 45 * learn from <https://github.com/stevearc/dotfiles/blob/master/.config/nvim/plugin/exrc.lua> and maybe adapt `std.localrc`
44 46 * setup DAP
45 47 * nvim spell for camel case words
46 -* learn marks and refactor mark.lua
47 48 * add nu-check to nvim-lint
48 49 * create skeleton-plugin for default file content based on file type (BufNewFile?)
49 50 * make lsp config extensible, so that plugin configs can hook into it (e.g. on_attach)

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

Modified
46 46 --FIXME: refactor this!
47 47 vim.list_extend( bundles,
48 48 vim.split(
49 + --TODO: jdtls seemingly cannot get bindle info out of this jar
50 + --
51 + -- Contains: Failed to get bundleInfo for bundle from /home/oli/.local/share/nvim/mason/packages/java-test/extension/server/com.microsoft.java.test.runner-jar-with-dependencies.jar
52 + -- "
49 53 vim.fn.glob( java_debug_path .. '/extension/server/com.microsoft.java.debug.plugin-*.jar' ), '\n' ) )
50 54 vim.list_extend( bundles, vim.split( vim.fn.glob( java_test_path .. '/extension/server/*.jar' ), '\n' ) )
51 55 return bundles
110 114 vim.notify 'missing jdk paths in java settings for lsp'
113 - return { jdk11, jdk17, jdk21 }
117 + return { jdk11, jdk17, jdk21, }
116 120 local java_settings = {
117 - signatureHelp = { enabled = true },
121 + signatureHelp = { enabled = true, },
118 122 sources = {
119 - autobuild = { enabeld = true },
120 - signatureHelp = { enabled = true },
121 - saveActions = { origanizeImports = true },
123 + autobuild = { enabeld = true, },
124 + signatureHelp = { enabled = true, },
125 + saveActions = { origanizeImports = true, },
122 126 organizeImports = {
123 127 starThreshold = 9999,
124 128 staticStarThreshold = 9999,
127 131 toString = {
128 132 template = '${object.className}{${member.name()}=${member.value()}, ${otherMembers}}',
130 - hashCodeEquals = { useJava7Objects = true },
134 + hashCodeEquals = { useJava7Objects = true, },
131 135 useBlocks = true,
133 - eclipse = { downloadSources = true },
137 + eclipse = { downloadSources = true, },
135 139 configuration = {
136 140 updateBuildConfiguration = 'interactive',
137 141 runtimes = find_jdks(),
139 - maven = { downloadSources = true },
140 - implementationsCodeLens = { enabled = true },
141 - referencesCodeLens = { enabled = true },
142 - references = { includeDecompiledSources = true },
143 - inlayHints = { parameterNames = { enabled = 'all' } },
143 + maven = { downloadSources = true, },
144 + implementationsCodeLens = { enabled = true, },
145 + referencesCodeLens = { enabled = true, },
146 + references = { includeDecompiledSources = true, },
147 + inlayHints = { parameterNames = { enabled = 'all', }, },
144 148 format = {
145 149 enabled = true,
146 150 -- TODO: set these here with my preferred settings
166 170 local on_attach = function ()
167 171 local jdtls = require 'jdtls'
168 172 vim.lsp.codelens.refresh()
169 - jdtls.setup_dap { hotcodereplace = 'auto' }
173 + jdtls.setup_dap { hotcodereplace = 'auto', }
170 174 require 'jdtls.dap'.setup_dap_main_class_configs()
171 175 require 'jdtls.setup'.add_commands()
249 253 root_dir = project.find_java_project_root,
250 254 single_file_support = true,
251 255 workspaces = true,
252 - settings = { java = java_settings },
256 + settings = { java = java_settings, },
253 257 on_attach = on_attach,
254 258 init_options = {
255 259 bundles = get_bundles(),
256 260 extendedClientCapabilities = get_extended_capabilites(),
257 - }
261 + },

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

Modified
12 12 Lua = {
13 13 addonManager = { enable = false, },
14 14 completion = { callSnippet = 'Replace', },
15 - diagnostics = { workspaceRate = 50, },
16 15 hint = { enable = true, setType = true, },
17 16 telemetry = { enable = false, },
18 17 window = { progressBar = true, statusBar = true, },

neovim/lua/bugabinga/lsp/init.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
2 2 local icon = require 'std.icon'
3 3 local defer = require 'std.defer'
4 4 local map = require 'std.map'
261 - local lsp_signature_ok, lsp_signature = pcall( require, 'lsp_signature' )
262 - if lsp_signature_ok then
263 - lsp_signature.on_attach( {}, bufnr )
264 - end
266 261 if client.server_capabilities.documentHighlightProvider then
267 262 -- the timer has application lifetime. no need to close
268 263 local delay = 300

neovim/lua/bugabinga/options/behaviour.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
2 2 local auto = require 'std.auto'
4 4 -- How many milliseconds must pass before neovim decides I was "idle"

neovim/lua/bugabinga/options/ui.lua

Modified
26 26 vim.opt.listchars = {
27 27 -- space = icon.space,
28 28 -- eol = icon.eol,
29 - tab = icon.tab .. icon.middle_ellipsis,
29 + -- tab = icon.tab .. icon.middle_ellipsis,
30 + tab = ' ',
30 31 trail = icon.trail,
31 32 extends = icon.extends,
32 33 precedes = icon.precedes,

neovim/lua/bugabinga/plugins/aerial.lua

Deleted
deleted file mode 100644
1 ---NOTE: this is such a cool idea! let's think about how to apply this more generally
2 -local lazy_aerial = setmetatable( {}, {
3 - __index = function ( _, k )
4 - return function ( ... ) require 'aerial'[k]( ... ) end
5 - end,
6 -} )
7 ---FIXME: own this
8 -return {
9 - {
10 - 'stevearc/resession.nvim',
11 - lazy = true,
12 - opts = {
13 - extensions = {
14 - aerial = {},
15 - },
16 - },
17 - },
18 - {
19 - 'stevearc/aerial.nvim',
20 - dependencies = {
21 - 'nvim-treesitter/nvim-treesitter',
22 - 'nvim-tree/nvim-web-devicons',
23 - -- Hack to ensure that lspkind-nvim is loaded
24 - 'hrsh7th/nvim-cmp',
25 - },
26 - cmd = { 'AerialToggle', 'AerialOpen', 'AerialNext', 'AerialPrev', },
27 - keys = {
28 - { '<leader>a', '<cmd>AerialToggle!<CR>', desc = '[A]erial toggle', mode = 'n', },
29 - { '<leader>A', '<cmd>AerialNavToggle<CR>', desc = '[A]erial nav toggle', mode = 'n', },
30 - { '[s', lazy_aerial.prev, desc = 'Previous aerial symbol', mode = { 'n', 'v', }, },
31 - { ']s', lazy_aerial.next, desc = 'Next aerial symbol', mode = { 'n', 'v', }, },
32 - { '[u', lazy_aerial.prev_up, desc = 'Previous aerial parent symbol', mode = { 'n', 'v', }, },
33 - { ']u', lazy_aerial.next_up, desc = 'Next aerial parent symbol', mode = { 'n', 'v', }, },
34 - },
35 - opts = {
36 - show_guides = true,
37 - layout = {
38 - max_width = { 80, 0.2, },
39 - default_direction = 'prefer_left',
40 - -- placement = "edge",
41 - -- preserve_equality = true,
42 - },
43 - -- attach_mode = "global",
44 - highlight_on_hover = true,
45 - close_automatic_events = {
46 - -- "unfocus",
47 - -- "switch_buffer",
48 - -- "unsupported",
49 - },
50 - -- open_automatic = true,
51 - -- highlight_on_jump = false,
52 - link_folds_to_tree = true,
53 - link_tree_to_folds = true,
54 - manage_folds = {
55 - ['_'] = true,
56 - },
57 - nerd_font = vim.g.nerdfont,
59 - -- backends = { "treesitter", "markdown" },
60 - -- backends = { "lsp", "treesitter" },
61 - lazy_load = false,
62 - -- backends = { "lsp", "treesitter", "markdown" },
63 - -- filter_kind = false,
64 - keymaps = {
65 - ['<'] = 'actions.tree_decrease_fold_level',
66 - ['>'] = 'actions.tree_increase_fold_level',
67 - },
68 - treesitter = {
69 - experimental_selection_range = true,
70 - },
71 - },
72 - },
73 -}

neovim/lua/bugabinga/plugins/cmp.lua

Modified
1 1 local map = require 'std.map'
2 2 local user_command = require 'std.user_command'
4 -map.insert {
5 - description = 'Trigger cmp autocomplete',
6 - category = 'completion',
7 - keys = '<c-x><c-o>',
8 - command = function () prequire 'cmp'.complete() end,
9 -}
11 -user_command.CmpInfo
12 -'Display status information about the completion engine cmp' (
13 - prequire 'cmp'.status
14 - )
3 +local icon = require 'std.icon'
16 5 return {
17 6 'hrsh7th/nvim-cmp',
7 + lazy = false,
18 8 dependencies = {
19 9 'hrsh7th/cmp-nvim-lsp',
20 10 'hrsh7th/cmp-buffer',
73 63 formatting.format = lspkind.cmp_format {
74 64 mode = 'symbol',
75 65 symbol_map = {
76 - Copilot = ' ',
77 - Class = '󰆧 ',
78 - Color = '󰏘 ',
79 - Constant = '󰏿 ',
80 - Constructor = ' ',
81 - Enum = ' ',
82 - EnumMember = ' ',
83 - Event = '',
84 - Field = ' ',
85 - File = '󰈙 ',
86 - Folder = '󰉋 ',
87 - Function = '󰊕 ',
88 - Interface = ' ',
89 - Keyword = '󰌋 ',
90 - Method = '󰊕 ',
91 - Module = ' ',
92 - Operator = '󰆕 ',
93 - Property = ' ',
94 - Reference = '󰈇 ',
95 - Snippet = ' ',
96 - Struct = '󰆼 ',
97 - Text = '󰉿 ',
98 - TypeParameter = '󰉿 ',
99 - Unit = '󰑭',
100 - Value = '󰎠 ',
101 - Variable = '󰀫 ',
66 + Copilot = icon.copilot,
67 + Class = icon.class,
68 + Color = icon.color,
69 + Constant = icon.constant,
70 + Constructor = icon.constructor,
71 + Enum = icon.enum,
72 + EnumMember = icon.enum_member,
73 + Event = icon.event,
74 + Field = icon.field,
75 + File = icon.file,
76 + Folder = icon.folder,
77 + Function = icon['function'],
78 + Interface = icon.interface,
79 + Keyword = icon.keyword,
80 + Method = icon.method,
81 + Module = icon.module,
82 + Operator = icon.operator,
83 + Property = icon.property,
84 + Reference = icon.reference,
85 + Snippet = icon.snippet,
86 + Struct = icon.struct,
87 + Text = icon.text,
88 + TypeParameter = icon.type_parameter,
89 + Unit = icon.unit,
90 + Value = icon.value,
91 + Variable = icon.variable,
103 93 menu = {
104 94 buffer = '[buf]',

neovim/lua/bugabinga/plugins/fidget.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
3 3 return {
4 4 'j-hui/fidget.nvim',

neovim/lua/bugabinga/plugins/format.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
2 2 local map = require 'std.map'
3 3 local user_command = require 'std.user_command'

neovim/lua/bugabinga/plugins/lsp_signature.lua

Deleted
deleted file mode 100644
1 -return {
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/tests.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
2 2 local icon = require 'std.icon'
3 3 local map = require 'std.map'

neovim/lua/bugabinga/plugins/window.lua

Modified
5 5 description = 'Open window picker...',
6 6 category = 'navigation',
7 7 keys = '<c-w>a',
8 - command = function () require 'nvim-window'.pick() end,
8 + command = function () prequire 'nvim-window'.pick() end,
11 11 user_command.PickWindow
12 12 'Pick a window with a simple char motion' (
13 - prequire 'nvim-window'.pick
13 + function () prequire 'nvim-window'.pick() end
16 16 return {

neovim/lua/bugabinga/terminal.lua

Modified
23 23 command = [[ <C-\><C-n> ]],
26 - map.terminal {
26 + map.terminal.normal {
27 27 description = 'Close current terminal',
28 28 category = 'terminal',
29 29 keys = '<F7>',

neovim/lua/std/dbg.lua

Added
new file mode 100644
1 +local user_command = require 'std.user_command'
3 +if vim.g.bugabinga_debug_mode == nil then
4 + vim.g.bugabinga_debug_mode = false
5 +end
7 +local function is_debug_mode()
8 + return vim.g.bugabinga_debug_mode
9 +end
11 +local function print_debug( message, ... )
12 + if is_debug_mode() then
13 + -- TODO: pipe messages into custom debug buffer and file
14 + vim.print( message, ... )
15 + end
16 +end
18 +local function toggle_debug_mode()
19 + vim.g.bugabinga_debug_mode = not vim.g.bugabinga_debug_mode
20 + vim.notify( 'Toggled debug mode to ' .. tostring( is_debug_mode() ) )
21 +end
23 +user_command.Debug 'Toggle global vim config debug mode.' ( toggle_debug_mode )
25 +return {
26 + print = print_debug,
27 + toggle = toggle_debug_mode,
28 + get = is_debug_mode,

neovim/lua/std/debug.lua

Deleted
deleted file mode 100644
1 -local user_command = require 'std.user_command'
3 -if vim.g.bugabinga_debug_mode == nil then
4 - vim.g.bugabinga_debug_mode = false
5 -end
7 -local function is_debug_mode()
8 - return vim.g.bugabinga_debug_mode
9 -end
11 -local function print_debug( message, ... )
12 - if is_debug_mode() then
13 - -- TODO: pipe messages into custom debug buffer and file
14 - vim.print( message, ... )
15 - end
16 -end
18 -local function toggle_debug_mode()
19 - vim.g.bugabinga_debug_mode = not vim.g.bugabinga_debug_mode
20 - vim.notify( 'Toggled debug mode to ' .. tostring( is_debug_mode() ) )
21 -end
23 -user_command.Debug 'Toggle global vim config debug mode.' ( toggle_debug_mode )
25 -return {
26 - print = print_debug,
27 - toggle = toggle_debug_mode,
28 - get = is_debug_mode,
29 -}

neovim/lua/std/icon.lua

Modified
10 10 carriage_return = '␍',
11 11 checkbox_mark = '',
12 12 checkbox_unmark = '',
13 - class = ' ',
13 + class = '󰆧 ',
14 14 close = '',
15 15 color = ' ',
16 16 command = '󰘳',
17 17 constant = ' ',
18 18 constructor = ' ',
19 + copilot = ' ',
19 20 data = '',
20 21 diagnostic = '⊙',
21 22 diff_add = '',
26 27 eol = '↴',
27 28 error = '󰇷',
28 29 esc_key = '󱊷',
30 + event = '',
29 31 exclaim = '',
30 32 extends = '❯',
31 33 failed = ' ',
32 - field = '󰄶 ',
34 + field = ' ',
33 35 file = '',
34 36 folder = '',
35 37 git = '',
39 41 hint = '',
40 42 info = '󰩖',
41 43 insert = '',
42 - interface = '󰜰',
44 + interface = ' ',
43 45 keyword = '󰌆 ',
44 46 lazy = '󰄻',
45 47 leader_key = '󱁐',
48 50 lock = '',
49 51 lsp = '',
50 52 macro = '',
51 - method = 'ƒ ',
53 + method = '󰊕 ',
52 54 middle_ellipsis = '⋯',
53 55 modified = '',
54 - module = '󰏗 ',
56 + module = ' ',
55 57 nbsp = '␣',
56 58 newline = '␤',
57 59 normal = 'Ν',
60 + operator = '󰆕 ',
58 61 passed = ' ',
59 62 pending = '',
60 63 precedes = '❮',
71 74 property = ' ',
72 75 quot_left = '"',
73 76 quot_right = '"',
77 + reference = '󰈇 ',
74 78 replace = '',
75 79 return_key = '',
76 80 running = ' ',
77 81 select = '󰒉',
78 82 slant_left = '▟',
79 83 slant_right = '▙',
80 - snippet = '󰘍 ',
84 + snippet = ' ',
81 85 space = '·',
82 86 space_key = '󱁐',
83 87 spelling = '󰓆',
93 97 toggle_off = '',
94 98 toggle_on = '',
95 99 trail = '•',
100 + type_parameter = '󰉿 ',
96 101 unit = ' ',
97 102 unknown = ' ',
98 103 user = ' ',
99 104 value = '󰎠 ',
100 - variable = ' ',
105 + variable = '󰀫 ',
101 106 vertical_bar = '│',
102 107 vim = '',
103 108 virtual = '󰢔',

neovim/lua/std/localrc.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
3 3 --- loads given lua file path in current working directory into the current neovim lua runtime.
4 4 --- @param file_name string path to lua file, that should be loaded

neovim/lua/std/prequire.lua

Modified
1 +local dbg = require 'std.dbg'
3 +local function printStackTrace()
4 + local level = 2
5 + while true do
6 + local info = debug.getinfo( level, 'nSl' )
7 + if not info then break end
8 + dbg.print( string.format( "%s:%d in function '%s'", info.short_src, info.currentline, info.name or '' ) )
9 + level = level + 1
10 + end
11 +end
1 13 ---Require one or more modules gracefully.
2 14 ---Calls `require` in protected mode.
3 15 ---@example
4 ---- local want = require 'std.want'
5 ---- want 'foo'.setup {}
6 ---- want('foo', 'bar', function(foo, bar)
16 +--- local want = require 'std.prequire'
17 +--- prequire 'foo'.setup {}
18 +--- prequire('foo', 'bar', function(foo, bar)
7 19 --- foo.setup{arg = bar}
8 20 --- end)
9 21 ---@see pcall
29 41 table.insert( mods, mod )
30 42 else
43 + printStackTrace()
31 44 vim.notify_once( string.format( 'Missing module: %s', arg ), vim.log.levels.WARN )
32 45 -- Return a proxy item that returns itself, so we can do things like
33 - -- grace("module").setup()
46 + -- prequire("module").setup()
34 47 local proxy = {}
35 48 setmetatable( proxy, {
36 49 __call = function ()

neovim/lua/std/project.lua

Modified
1 -local debug = require 'std.debug'
1 +local debug = require 'std.dbg'
2 2 local table = require 'std.table'
3 3 local join = table.join
4 4 local dirname = vim.fs.dirname

neovim/spell/nerd.utf-8.add

Modified
54 54 kool
55 55 grepprg
56 56 makeprg
57 +modulepath
58 +FFI
59 +jdtls

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

Modified

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

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