dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim: creates a debug mode
df0494fdadca4c566ef42a5a7ec14545ef85edf0
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (8)
neovim/ftplugin/markdown.lua
Modified2 -vim.opt_local.autowriteall
= true 5 -vim.opt_local.spell
== true 2 +vim.opt_local.spell
= true 15 +local debug = require 'std.debug' 14 -ok
= pcall(
require,
'bugabinga.options' )
15 -if not ok
then print 'error while loading options' end 19 +ok, loaded
= pcall(
require,
'bugabinga.options' )
20 +if not ok
then vim.print (
'error while loading options', loaded )
end 18 -ok
= pcall(
require,
'bugabinga.lazy' )
19 -if not ok
then print 'error while loading lazy' end 23 +ok, loaded
= pcall(
require,
'bugabinga.lazy' )
24 +if not ok
then vim.print (
'error while loading lazy' ,loaded)
end 22 -ok
= pcall(
require,
'bugabinga.diagnostic' )
23 -if not ok
then print 'error while loading diagnostic' end 27 +ok, loaded
= pcall(
require,
'bugabinga.diagnostic' )
28 +if not ok
then vim.print (
'error while loading diagnostic' ,loaded)
end 26 -ok
= pcall(
require,
'bugabinga.trim' )
27 -if not ok
then print 'error while loading trim' end 31 +ok, loaded
= pcall(
require,
'bugabinga.trim' )
32 +if not ok
then vim.print (
'error while loading trim' ,loaded)
end 30 -ok
= pcall(
require,
'bugabinga.mark' )
31 -if not ok
then print 'error while loading mark' end 35 +ok, loaded
= pcall(
require,
'bugabinga.mark' )
36 +if not ok
then vim.print (
'error while loading mark' ,loaded)
end 34 -ok
= pcall(
require,
'bugabinga.lsp' )
35 -if not ok
then print 'error while loading lsp' end 39 +ok, loaded
= pcall(
require,
'bugabinga.lsp' )
40 +if not ok
then vim.print (
'error while loading lsp' ,loaded)
end neovim/lazy-lock.json
Modified15 15 "diffview.nvim": {
"branch":
"main",
"commit":
"3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
16 16 "dressing.nvim": {
"branch":
"master",
"commit":
"6f212262061a2120e42da0d1e87326e8a41c0478" },
17 17 "flash.nvim": {
"branch":
"main",
"commit":
"48817af25f51c0590653bbc290866e4890fe1cbe" },
18 - "friendly-snippets": {
"branch":
"main",
"commit":
"5cc1f45c6aac699ad008fb85f6ae03236062667d" },
18 + "friendly-snippets": {
"branch":
"main",
"commit":
"dbd45e9ba76d535e4cba88afa1b7aa43bb765336" },
19 19 "gen.nvim": {
"branch":
"main",
"commit":
"98043162168dcc0eb5c3c31b97439ff686dc8559" },
20 20 "gitsigns.nvim": {
"branch":
"main",
"commit":
"2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
21 21 "glow.nvim": {
"branch":
"main",
"commit":
"238070a686c1da3bccccf1079700eb4b5e19aea4" },
32 32 "mini.colors": {
"branch":
"main",
"commit":
"f64963332f7fcb45c8dfcc243f682a9a0fb9935d" },
33 33 "mini.starter": {
"branch":
"main",
"commit":
"ce222a5b6de50a9963c1eb62aa16ec6d5efca7ee" },
34 34 "mkdir.nvim": {
"branch":
"main",
"commit":
"c55d1dee4f099528a1853b28bb28caa802eba217" },
35 - "neodev.nvim": {
"branch":
"main",
"commit":
"365ef03dbf5b8579e6eb205b3500fc3bee17484a" },
35 + "neodev.nvim": {
"branch":
"main",
"commit":
"fdf6b3c58caf3ed1bfe40822d5dac340fc18c33b" },
36 36 "neogen": {
"branch":
"main",
"commit":
"70127baaff25611deaf1a29d801fc054ad9d2dc1" },
37 37 "noice.nvim": {
"branch":
"main",
"commit":
"bf67d70bd7265d075191e7812d8eb42b9791f737" },
38 38 "nrpattern.nvim": {
"branch":
"master",
"commit":
"f862ce687761078ef3155688151c55f69d28453e" },
39 - "nui.nvim": {
"branch":
"main",
"commit":
"af7dfee12fbf51d12cfc6ee386fa54f7a5a573c8" },
40 - "nvim-autopairs": {
"branch":
"master",
"commit":
"096d0baecc34f6c5d8a6dd25851e9d5ad338209b" },
39 + "nui.nvim": {
"branch":
"main",
"commit":
"c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
40 + "nvim-autopairs": {
"branch":
"master",
"commit":
"90f824d37c0cb079d2764927e73af77faa9ba0ef" },
41 41 "nvim-cmp": {
"branch":
"main",
"commit":
"04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
42 42 "nvim-colorizer.lua": {
"branch":
"master",
"commit":
"85855b38011114929f4058efc97af1059ab3e41d" },
43 - "nvim-genghis": {
"branch":
"main",
"commit":
"357bc2688d231e0daf8468a63985e20c1609ceb7" },
43 + "nvim-genghis": {
"branch":
"main",
"commit":
"d04dbfe57b0ae908ba8e397962a1fcef98ca9fd9" },
44 44 "nvim-gomove": {
"branch":
"main",
"commit":
"2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
45 45 "nvim-jdtls": {
"branch":
"master",
"commit":
"a4746791876166dc146eae573a1b49d24a6652e7" },
46 46 "nvim-lastplace": {
"branch":
"main",
"commit":
"0bb6103c506315044872e0f84b1f736c4172bb20" },
47 47 "nvim-neoclip.lua": {
"branch":
"main",
"commit":
"798cd0592a81c185465db3a091a0ff8a21af60fd" },
48 - "nvim-notify": {
"branch":
"master",
"commit":
"80b67b265530632505193553d05127ae7fe09ddd" },
48 + "nvim-notify": {
"branch":
"master",
"commit":
"5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
49 49 "nvim-spectre": {
"branch":
"master",
"commit":
"e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
50 50 "nvim-surround": {
"branch":
"main",
"commit":
"8f2af76134f37058dc4c27a24bc5f86c9cae76dc" },
51 - "nvim-tree.lua": {
"branch":
"master",
"commit":
"863cf832ceb0b2377c913b7696dd7d64f4978941" },
52 - "nvim-treesitter": {
"branch":
"master",
"commit":
"bdaa6b817aaef459e2d1968c50ce0061e51410e8" },
53 - "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" },
51 + "nvim-tree.lua": {
"branch":
"master",
"commit":
"030defdb6522f5f716d8201d20ca1a2baa57ca66" },
52 + "nvim-treesitter": {
"branch":
"master",
"commit":
"d1484a1507b36ca6af7f7925c627846010faeabe" },
53 + "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" },
54 54 "nvim-ts-autotag": {
"branch":
"main",
"commit":
"531f48334c422222aebc888fd36e7d109cb354cd" },
55 55 "nvim-ts-context-commentstring": {
"branch":
"main",
"commit":
"7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
56 - "nvim-web-devicons": {
"branch":
"master",
"commit":
"7f30f2da3c3641841ceb0e2c150281f624445e8f" },
56 + "nvim-web-devicons": {
"branch":
"master",
"commit":
"14ac5887110b06b89a96881d534230dac3ed134d" },
57 57 "nvim-window": {
"branch":
"main",
"commit":
"e7f5d60eeec8ff37af7be4c9a99f65edf67fc574" },
58 - "oil.nvim": {
"branch":
"master",
"commit":
"bf753c3e3f8736939ad5597f92329dfe7b1df4f5" },
59 - "oxocarbon.nvim": {
"branch":
"main",
"commit":
"c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" },
58 + "oil.nvim": {
"branch":
"master",
"commit":
"6953c2c17d8ae7454b28c44c8767eebede312e6f" },
60 59 "persistence.nvim": {
"branch":
"main",
"commit":
"4982499c1636eac254b72923ab826ee7827b3084" },
61 60 "playground": {
"branch":
"master",
"commit":
"ba48c6a62a280eefb7c85725b0915e021a1a0749" },
62 61 "plenary.nvim": {
"branch":
"master",
"commit":
"4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
63 - "schemastore.nvim": {
"branch":
"main",
"commit":
"91b56a811d87b9e7e0600c95f80ff2d08245bf61" },
62 + "schemastore.nvim": {
"branch":
"main",
"commit":
"adaca44ad56bd74ae0e4e500320a7dd6f216650a" },
64 63 "specs.nvim": {
"branch":
"main",
"commit":
"2743e412bbe21c9d73954c403d01e8de7377890d" },
65 64 "speedtyper.nvim": {
"branch":
"main",
"commit":
"2d158eed4c753995b0501a3a7a72464fbb213e3d" },
66 65 "ssr.nvim": {
"branch":
"main",
"commit":
"bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
neovim/lua/bugabinga/lazy.lua
Modified 29 29 colorscheme = {
'nugu',
'quiet' },
neovim/lua/bugabinga/lsp/init.lua
Modified 1 1 require 'bugabinga.lsp.lightbulb' 3 +local debug = require 'std.debug' 3 4 local defer
= require 'std.defer' 4 5 local map
= require 'std.map' 5 6 local auto
= require 'std.auto' 37 38 local expand_command = function ( command )
38 39 vim.validate {
command = { command, {
'string',
'table' } } }
41 + debug.print(
'expanding command', command )
42 43 if type( command )
== 'table' then 43 44 command[
1]
= expand_path( command[
1] )
51 52 local match
= file_type_event.match
53 54 local matches_to_ignore
= ignored.filetypes
55 + debug.print(
'filetypes to ignore', matches_to_ignore )
55 56 if vim.iter( matches_to_ignore ):find( match )
then return end 57 58 local bufnr
= file_type_event.buf
61 62 local buffer_path
= vim.api.nvim_buf_get_name( bufnr )
63 - vim.notify(
string.
format(
'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) )
64 + debug.print(
string.
format(
'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) )
65 66 local potential_client_configs
= vim.iter( lsp_client_configs )
66 67 :map(
function ( config )
101 + debug.print(
'POTENTIAL CLIENTS',
102 + vim.iter( potential_client_configs ):map(
function ( config )
return {
name = config.name,
command = config.command }
end )
102 105 if table.is_empty( potential_client_configs )
then 106 + debug.print(
'found no lsp client for', buffer_path )
114 117 local capabilities
= vim.lsp.protocol.make_client_capabilities()
115 118 local cmp_capabilities
= require 'cmp_nvim_lsp'.default_capabilities()
116 119 capabilities
= table.extend(
'force', capabilities, cmp_capabilities, config.capabilities )
120 + debug.print(
'lsp capabilities', capabilities, config.capabilities, cmp_capabilities )
122 + debug.print(
'starting command:', config.command )
121 124 local start_config
= {
122 125 cmd = config.command,
136 139 before_init
= config.before_init,
138 141 on_exit = function ( code, signal, client_id ) vim.print(
'LSP CLIENT EXIT', code, signal, client_id )
end,
142 + on_attach = function ( client, bufnr )
debug.print(
'LSP CLIENT ATTACH', client, bufnr )
end,
141 144 flags
= {
allow_incremental_sync =
true,
debounce_text_changes =
250,
exit_timeout =
200 },
142 145 root_dir
= root_dir,
145 148 local lsp_starter
= config.custom_start
or vim.lsp.start
150 + debug.print(
'starting lsp', start_config.name, root_dir )
149 152 lsp_starter( start_config, {
153 156 reuse_client =
function ( existing_client, new_config )
158 + 'lsp resuse client',
159 + existing_client.name,
160 + existing_client.workspace_folders,
162 + new_config.root_dir
163 166 local same_name
= existing_client.name
== new_config.name
173 176 local same_root
= new_root
== existing_root
175 178 local reuse
= same_name
and same_root
179 + debug.print(
'reusing lsp client?', reuse )
184 + debug.print(
'ATTACHING LSP CLIENT', client_id )
199 202 local client
= vim.lsp.get_client_by_id( args.data.client_id )
200 203 if not client
then return end 205 + debug.print( client.server_capabilities )
204 207 if client.server_capabilities.definitionProvider
then 205 208 old_tagfunc
= vim.bo[bufnr].tagfunc
326 329 local lsp_detach = function ( args )
330 + debug.print(
'DETACH LSP', args )
329 332 local bufnr
= args.buf
330 333 local client_id
= args.data.client_id
neovim/lua/std/debug.lua
Addednew file mode 100644 1 +if vim.g.bugabinga_debug_mode
== nil then 2 + vim.g.bugabinga_debug_mode
= false 5 +local function is_debug_mode()
6 + return vim.g.bugabinga_debug_mode
9 +local function print_debug(
... )
10 + if is_debug_mode()
then 15 +local function toggle_debug_mode()
16 + vim.g.bugabinga_debug_mode
= not vim.g.bugabinga_debug_mode
17 + vim.notify(
'Toggled debug mode to ' .. tostring(is_debug_mode()) )
20 +vim.api.nvim_create_user_command(
'Debug', toggle_debug_mode ,{})
23 + print = print_debug,
24 + toggle = toggle_debug_mode,
25 + get = is_debug_mode,
neovim/lua/std/project.lua
Modified 1 +local debug = require 'std.debug' 1 2 local table = require 'std.table' 2 3 local join
= table.join
3 4 local dirname
= vim.fs.dirname
102 103 local current_path
= path
103 104 while current_path
~= stop
do 104 105 if loop_count
> MAX_TRAVERSAL_COUNT
then 105 - vim.notify( (
'searching for markers reached the max traversal count for path %s !'):format( path ) )
106 + debug.print( (
'searching for markers reached the max traversal count for path %s !'):format( path ) )
new file mode 100644 5 +~/.config/git/.gitconfig.include
20 +~/.local/bin/git-info
29 +~/.config/nushell/config.nu
32 +~/.config/nushell/env.nu
35 +~/.config/nushell/modules
38 +~/.config/nushell/plugin.nu
43 +topgrade/topgrade.linux.toml
44 +~/.config/topgrade.toml
46 +indexa/config.linux.toml
47 +~/.config/indexa/config.toml
52 +wezterm/wezterm.service
53 +~/.config/systemd/user/wezterm.service
56 +~/.config/helix/config.toml
59 +~/.config/helix/languages.toml
62 +~/.config/helix/themes
64 +helix/systemd/helix-dark-mode.service
65 +~/.config/systemd/user/helix-dark-mode.service