repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: more robust error handling in config

977240bc8ab3351e4814eb92c7c78bdfcb09c6bf

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (15)

neovim/README.md

Modified
39 39 # todo
41 41 * pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
42 -* think about mini.colors + nugu + nushell
43 42 * use gen.ai to generate docs
44 43 * learn marks and refactor mark.lua
45 44 * use ltex-ls for markdown, code comments and commit messages

neovim/colors/nugu.lua

Modified
1 -if vim.g.colors_name == nil then
2 - -- Get the current hour
3 - local current_hour = tonumber(os.date('%H'))
1 +if vim.g.colors_name == nil then
2 + -- Get the current hour
3 + local current_hour = tonumber( os.date '%H' )
5 - -- Set the background based on the time of day
6 - if current_hour >= 9 and current_hour < 19 then
7 - vim.opt.background = 'light'
8 - else
9 - vim.opt.background = 'dark'
10 - end
5 + -- Set the background based on the time of day
6 + if current_hour >= 9 and current_hour < 17 then
7 + -- print"setting background to light"
8 + vim.opt.background = 'light'
9 + else
10 + -- print"setting background to dark"
11 + vim.opt.background = 'dark'
12 + end
13 15 vim.g.colors_name = 'nugu'
19 21 local lush = require 'lush'
20 22 local nugu = require 'bugabinga.nugu'
21 -lush(nugu)
23 +lush( nugu )

neovim/init.lua

Modified
7 7 -- ███ █▄ ▄█ ███ █ ███ ▐ █ █ █ ███ █
8 8 -- ▀▀▀ █ █ ██ █
9 9 -- ▀ ▀
11 +local ok
10 13 -- set general neovim editor settings
11 -require 'bugabinga.options'
14 +ok = pcall( require, 'bugabinga.options' )
15 +if not ok then print 'error while loading options' end
12 17 -- install plugin manager and declare plugins to use
13 -require 'bugabinga.lazy'
18 +ok = pcall( require, 'bugabinga.lazy' )
19 +if not ok then print 'error while loading lazy' end
14 21 -- configures the vim diagnostic subsystem
15 -require 'bugabinga.diagnostic'
22 +ok = pcall( require, 'bugabinga.diagnostic' )
23 +if not ok then print 'error while loading diagnostic' end
16 25 -- Defines `TrimTrailingWhitespace` command
17 -require 'bugabinga.trim'
26 +ok = pcall( require, 'bugabinga.trim' )
27 +if not ok then print 'error while loading trim' end
18 29 -- visualize marks in signcolumn
19 -require 'bugabinga.mark'
30 +ok = pcall( require, 'bugabinga.mark' )
31 +if not ok then print 'error while loading mark' end
20 33 -- setup lsp clients
21 -require 'bugabinga.lsp'
34 +ok = pcall( require, 'bugabinga.lsp' )
35 +if not ok then print 'error while loading lsp' end

neovim/lazy-lock.json

Modified
3 3 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
4 4 "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
5 5 "actions-preview.nvim": { "branch": "master", "commit": "9e86d014a72a4121ee27f3d8952e1ea868c3c8c4" },
6 + "auto-dark-mode.nvim": { "branch": "master", "commit": "76e8d40d1e1544bae430f739d827391cbcb42fcc" },
6 7 "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
7 8 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
8 9 "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
24 25 "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
25 26 "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
26 27 "lush.nvim": { "branch": "main", "commit": "2e8d34e748642621d761a65e3c2a198154b914e8" },
28 + "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" },
27 29 "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
28 30 "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" },
29 31 "mini.bracketed": { "branch": "main", "commit": "65c7dfb51e832de9e279e5d5b0741e7af6755ab5" },
34 36 "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
35 37 "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
36 38 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
37 - "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
39 + "nui.nvim": { "branch": "main", "commit": "af7dfee12fbf51d12cfc6ee386fa54f7a5a573c8" },
38 40 "nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" },
39 41 "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
40 42 "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
47 49 "nvim-spectre": { "branch": "master", "commit": "e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
48 50 "nvim-surround": { "branch": "main", "commit": "8f2af76134f37058dc4c27a24bc5f86c9cae76dc" },
49 51 "nvim-tree.lua": { "branch": "master", "commit": "863cf832ceb0b2377c913b7696dd7d64f4978941" },
50 - "nvim-treesitter": { "branch": "master", "commit": "5a5cabd712b8bd14768c72034479fb9cd176beb6" },
52 + "nvim-treesitter": { "branch": "master", "commit": "bdaa6b817aaef459e2d1968c50ce0061e51410e8" },
51 53 "nvim-treesitter-textobjects": { "branch": "master", "commit": "dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" },
52 54 "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
53 55 "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },

neovim/lua/bugabinga/nugu/init.lua

Modified
39 39 local content_accent = hsl( palette.content_accent )
40 40 local content_minor = hsl( palette.content_minor )
41 41 local content_focus = hsl( palette.content_focus )
42 -local content_unfocus = flux( hsl( palette.content_unfocus ), 33 ) -- FIXME: this change needs to go into nugu
42 +local content_unfocus = flux( hsl( palette.content_unfocus ), 21 ) -- FIXME: this change needs to go into nugu
43 43 local content_important_global = hsl( palette.content_important_global )
44 44 local content_important_local = hsl( palette.content_important_local )
65 65 Search { fg = content_important_global, bg = content_important_global.readable() },
66 66 IncSearch { fg = content_important_local, bg = content_important_local.readable() },
67 67 NormalFloat { fg = ui_normal, bg = ui_backdrop },
68 - FloatBorder { fg = ui_accent, bg = Normal.bg },
68 + FloatBorder { fg = NormalFloat.bg, bg = NormalFloat.bg },
69 69 ColorColumn { fg = ui_important_global, bg = Normal.bg },
70 70 Conceal { fg = content_focus, bg = Normal.bg },
71 71 Cursor { bg = ui_accent },
312 312 NoiceCmdlineIconSearch { NoiceCmdlineIcon },
314 314 NoiceCmdlinePopup { NormalFloat },
315 - NoiceCmdlinePopupBorder { NoiceCmdlinePopup },
316 - NoiceCmdlinePopupBorderCalculator { NoiceCmdlinePopup },
317 - NoiceCmdlinePopupBorderCmdline { NoiceCmdlinePopup },
318 - NoiceCmdlinePopupBorderFilter { NoiceCmdlinePopup },
319 - NoiceCmdlinePopupBorderHelp { NoiceCmdlinePopup },
320 - NoiceCmdlinePopupBorderIncRename { NoiceCmdlinePopup },
321 - NoiceCmdlinePopupBorderInput { NoiceCmdlinePopup },
322 - NoiceCmdlinePopupBorderLua { NoiceCmdlinePopup },
323 - NoiceCmdlinePopupBorderSearch { NoiceCmdlinePopup },
315 + NoiceCmdlinePopupBorder { FloatBorder },
316 + NoiceCmdlinePopupBorderCalculator { NoiceCmdlinePopupBorder },
317 + NoiceCmdlinePopupBorderCmdline { NoiceCmdlinePopupBorder },
318 + NoiceCmdlinePopupBorderFilter { NoiceCmdlinePopupBorder },
319 + NoiceCmdlinePopupBorderHelp { NoiceCmdlinePopupBorder },
320 + NoiceCmdlinePopupBorderIncRename { NoiceCmdlinePopupBorder },
321 + NoiceCmdlinePopupBorderInput { NoiceCmdlinePopupBorder },
322 + NoiceCmdlinePopupBorderLua { NoiceCmdlinePopupBorder },
323 + NoiceCmdlinePopupBorderSearch { NoiceCmdlinePopupBorder },
324 324 NoiceCmdlinePopupTitle { NoiceCmdlinePopup },
325 - NoiceCmdlinePrompt { fg = ui_important_global, bg = ui_backdrop, gui = 'bold' },
325 + NoiceCmdlinePrompt { NoiceCmdlinePopup },
326 326 NoiceCompletionItemKindDefault { fg = ui_normal },
327 327 NoiceCompletionItemKindClass { NoiceCompletionItemKindDefault },
328 328 NoiceCompletionItemKindColor { NoiceCompletionItemKindDefault },
353 353 NoiceFormatConfirm { LazyButton },
354 354 NoiceFormatConfirmDefault { LazyButtonActive },
356 - -- NoiceCursor { Cursor },
356 + NoiceCursor { Cursor },
358 358 NoiceFormatDate { NonText },
359 359 NoiceFormatEvent { NonText },
445 445 GitSignsAddPreview { GitSignsAdd },
446 446 GitSignsDeletePreview { GitSignsDelete },
448 - GitSignsCurrentLineBlame { Debug },
448 + GitSignsCurrentLineBlame { NonText },
449 449 GitSignsAddInline { GitSignsAdd },
450 450 GitSignsDeleteInline { GitSignsDelete },
451 451 GitSignsChangeInline { GitSignsChange },

neovim/lua/bugabinga/options/behaviour.lua

Modified
6 6 vim.opt.timeoutlen = 250
8 8 -- wrap line movements, when start/end is reached
9 --- vim.opt.whichwrap:append'<'
10 --- vim.opt.whichwrap:append'>'
11 --- vim.opt.whichwrap:append'['
12 --- vim.opt.whichwrap:append']'
13 --- vim.opt.whichwrap:append'h'
14 --- vim.opt.whichwrap:append'l'
9 +vim.opt.whichwrap:append'<'
10 +vim.opt.whichwrap:append'>'
11 +vim.opt.whichwrap:append'['
12 +vim.opt.whichwrap:append']'
13 +vim.opt.whichwrap:append'h'
14 +vim.opt.whichwrap:append'l'
16 16 -- Tabs and Spaces, i like 'em 2 spaces wide
17 17 -- only insert spaces for tabs if language configuration explicitly declares so
99 99 if table.contains( ignored.filetypes, filetype ) then return end
100 100 local buftype = vim.api.nvim_buf_get_option( buffer, 'buftype' )
101 101 if table.contains( ignored.buftypes, buftype ) then return end
102 - local root = project.find_root_by_filetype( file, filetype )
103 - local cwd = vim.uv.cwd()
102 + local root = vim.fs.normalize(project.find_root_by_filetype( file, filetype ))
103 + local cwd = vim.fs.normalize(vim.uv.cwd())
104 104 if root and cwd ~= root then
105 105 vim.uv.chdir( root )
106 - vim.notify( 'Changed root directory to ' .. root )
106 + vim.notify( 'Changed root directory to ' .. root .. ' from ' .. cwd )
107 107 -- vim.print( buffer, file, vim.inspect( filetype ), vim.inspect( buftype ) )

neovim/lua/bugabinga/options/ui.lua

Modified
46 46 vim.opt.list = true
47 47 vim.opt.listchars = {
48 48 space = icon.space,
49 - eol = icon.eol,
49 + -- eol = icon.eol,
50 50 tab = icon.tab .. ' ',
51 51 trail = icon.trail,
52 52 extends = icon.extends,

neovim/lua/bugabinga/plugins/auto-dark-mode.lua

Added
new file mode 100644
1 +return {
2 + 'f-person/auto-dark-mode.nvim',
3 + priority = 1000,
4 + lazy = false,
5 + opts = {
6 + update_interval = 5000,
7 + },
8 +}

neovim/lua/bugabinga/plugins/commentstring.lua

Added
new file mode 100644
1 +return {
2 + 'JoosepAlviste/nvim-ts-context-commentstring',
3 + lazy = false,
4 + init = function ()
5 + vim.g.skip_ts_context_commentstring_module = true
6 + end,
7 + opts = { enable_autocmd = false },
8 +}

neovim/lua/bugabinga/plugins/mason.lua

Modified
8 8 height = 0.69,
11 + dependencies = {
12 + {
13 + 'WhoIsSethDaniel/mason-tool-installer.nvim',
14 + lazy = false,
15 + cmd = { "MasonToolsInstall", "MasonToolsInstallSync", "MasonToolsUpdate", "MasonToolsUpdateSync", "MasonToolsClean" },
16 + opts = {
17 + ensure_installed = {
18 + 'lua-language-server',
19 + 'shellcheck',
20 + 'editorconfig-checker',
21 + 'shfmt',
22 + 'jdtls',
23 + 'java-test',
24 + 'java-debug-adapter',
25 + 'lemminx',
26 + 'marksman',
27 + },
28 + }
29 + }
30 + }

neovim/lua/bugabinga/plugins/noice.lua

Modified
41 41 border = { style = vim.g.border_style },
42 42 position = { row = -2, col = 2 },
44 - -- does not seem to play well with other popups? -- treesitter in particular
45 44 cmdline = {
46 45 relative = 'cursor',
47 - position = { row = 0, col = -2 }, -- -2 makes the cursor stay in the same place
48 - size = { width = 'auto', height = 'auto' },
49 - border = { style = vim.g.border_style },
46 + position = { row = 0, col = 2 },
47 + size = { width = '42', height = 'auto' },
48 + border = { style = 'solid' },
49 + zindex = 9999,
51 51 cmdline_popupmenu = {
52 52 relative = 'cursor',
53 53 position = { row = 1, col = 0 },
54 - size = { width = 'auto', height = 'auto' },
54 + size = { width = '42', height = 'auto' },
55 55 border = { style = vim.g.border_style },
56 - win_options = { winhighlight = { Normal = 'NormalFloat', FloatBorder = 'FloatBorder' } },
56 + zindex = 9999,
59 59 routes = {

neovim/lua/bugabinga/plugins/oxocarbon.lua

Deleted
deleted file mode 100644
1 -return {
2 - 'nyoom-engineering/oxocarbon.nvim',
3 - lazy = false,
4 - priority = 1001,
5 - config = function ()
6 - vim.cmd.colorscheme 'oxocarbon'
7 - end,
8 -}

neovim/lua/bugabinga/plugins/treesitter.lua

Modified
27 27 require 'nvim-treesitter.install'.update { with_sync = true }
29 29 dependencies = {
30 - 'JoosepAlviste/nvim-ts-context-commentstring',
31 30 'windwp/nvim-ts-autotag',
32 31 'nvim-treesitter/playground',
33 32 'nvim-treesitter/nvim-treesitter-textobjects',
76 75 autotag = { enable = true },
78 - context_commentstring = { enable = true, enable_autocmd = false },
80 77 highlight = {
81 78 enable = true,
82 79 disable = function ( _, buf )

neovim/lua/std/icon.lua

Modified
45 45 quot_right = '󰉾',
46 46 replace = '',
47 47 select = '󰒉',
48 - space = '⋅',
48 + space = '·',
49 49 spelling = '󰓆',
50 50 subversion = '󰳗',
51 51 tab = '󰌒',

wezterm/wezterm.lua

Modified
18 18 enable_wayland = true
19 19 elseif hostname == 'pop-os' then
20 20 font_size = 15
21 -elseif hostname == 'PC-00625' then
21 +elseif hostname == 'NB-00718' then
22 22 font_size = 15