(T)im's N(ix) Flake, Multi-Host Configurations for all of my machines! 74k1.sh/
nixos nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(neovim): add a buncha stuff

- start using unused completions
- add tiny-inline-diagnostics

74k1 1d018379 5e2acb68

+180 -1
+33
modules/home-manager/shell/neovim/cfg/cmp.lua
··· 17 17 -- { name = 'copilot' }, 18 18 { name = 'nvim_lsp' }, 19 19 { name = 'luasnip' }, 20 + { name = 'emoji' }, 21 + { name = 'buffer' }, 22 + { 23 + name = 'path', 24 + option = { 25 + pathMappings = { 26 + ['@'] = '${folder}/src', 27 + -- ['/'] = '${folder}/src/public/', 28 + -- ['~@'] = '${folder}/src', 29 + -- ['/images'] = '${folder}/src/images', 30 + -- ['/components'] = '${folder}/src/components', 31 + }, 32 + }, 33 + }, 20 34 }), 35 + cmdline('/', { 36 + mapping = cmp.mapping.preset.cmdline(), 37 + sources = { 38 + { name = 'buffer' } 39 + } 40 + }), 41 + cmdline(':', { 42 + mapping = cmp.mapping.preset.cmdline(), 43 + sources = cmp.config.sources({ 44 + { name = 'path' } 45 + }, { 46 + { 47 + name = 'cmdline', 48 + option = { 49 + ignore_cmds = { 'Man', '!' } 50 + } 51 + } 52 + }) 53 + }) 21 54 }
+9 -1
modules/home-manager/shell/neovim/cfg/lspconfig.lua
··· 62 62 63 63 require("lspconfig").nil_ls.setup({ 64 64 cmd = { "nil" }, 65 + filetypes = { "nix" }, 66 + root_dir = root_pattern("flake.nix", ".git"), 67 + single_file_support = true, 65 68 settings = { 66 69 ["nil"] = { 67 70 formatting = { 68 71 command = { "nixfmt" }, 69 72 }, 73 + nix = { 74 + flake = { 75 + autoArchive = true, 76 + -- autoEvalInputs = true, 77 + }, 78 + }, 70 79 }, 71 80 }, 72 - single_file_support = true, 73 81 }) 74 82 75 83 require("lspconfig").rust_analyzer.setup({
+133
modules/home-manager/shell/neovim/cfg/tiny-inline-diagnostics.lua
··· 1 + require("tiny-inline-diagnostic").setup({ 2 + preset = "powerline", 3 + transparent_bg = false, 4 + -- transparent_cursorline = true, 5 + hi = { 6 + -- Highlight group for error messages 7 + error = "DiagnosticError", 8 + 9 + -- Highlight group for warning messages 10 + warn = "DiagnosticWarn", 11 + 12 + -- Highlight group for informational messages 13 + info = "DiagnosticInfo", 14 + 15 + -- Highlight group for hint or suggestion messages 16 + hint = "DiagnosticHint", 17 + 18 + -- Highlight group for diagnostic arrows 19 + arrow = "NonText", 20 + 21 + -- Background color for diagnostics 22 + -- Can be a highlight group or a hexadecimal color (#RRGGBB) 23 + background = "CursorLine", 24 + 25 + -- Color blending option for the diagnostic background 26 + -- Use "None" or a hexadecimal color (#RRGGBB) to blend with another color 27 + -- Default is "Normal" in the source code 28 + mixing_color = "Normal", 29 + }, 30 + options = { 31 + -- Display the source of the diagnostic (e.g., basedpyright, vsserver, lua_ls etc.) 32 + show_source = { 33 + enabled = false, 34 + -- Show source only when multiple sources exist for the same diagnostic 35 + if_many = false, 36 + }, 37 + 38 + -- Use icons defined in the diagnostic configuration instead of preset icons 39 + use_icons_from_diagnostic = false, 40 + 41 + -- Set the arrow icon to the same color as the first diagnostic severity 42 + set_arrow_to_diag_color = false, 43 + 44 + -- Add messages to diagnostics when multiline diagnostics are enabled 45 + -- If set to false, only signs will be displayed 46 + add_messages = true, 47 + 48 + -- Time (in milliseconds) to throttle updates while moving the cursor 49 + -- Increase this value for better performance on slow computers 50 + -- Set to 0 for immediate updates and better visual feedback 51 + throttle = 20, 52 + 53 + -- Minimum message length before wrapping to a new line 54 + softwrap = 30, 55 + 56 + -- Configuration for multiline diagnostics 57 + -- Can be a boolean or a table with detailed options 58 + multilines = { 59 + -- Enable multiline diagnostic messages 60 + enabled = false, 61 + 62 + -- Always show messages on all lines for multiline diagnostics 63 + always_show = false, 64 + 65 + -- Trim whitespaces from the start/end of each line 66 + trim_whitespaces = false, 67 + 68 + -- Replace tabs with this many spaces in multiline diagnostics 69 + tabstop = 4, 70 + }, 71 + 72 + -- Display all diagnostic messages on the cursor line, not just those under cursor 73 + show_all_diags_on_cursorline = false, 74 + 75 + -- Enable diagnostics in Insert mode 76 + -- If enabled, consider setting throttle to 0 to avoid visual artifacts 77 + enable_on_insert = false, 78 + 79 + -- Enable diagnostics in Select mode (e.g., when auto-completing with Blink) 80 + enable_on_select = false, 81 + 82 + -- Manage how diagnostic messages handle overflow 83 + overflow = { 84 + -- Overflow handling mode: 85 + -- "wrap" - Split long messages into multiple lines 86 + -- "none" - Do not truncate messages 87 + -- "oneline" - Keep the message on a single line, even if it's long 88 + mode = "wrap", 89 + 90 + -- Trigger wrapping this many characters earlier when mode == "wrap" 91 + -- Increase if the last few characters of wrapped diagnostics are obscured 92 + padding = 0, 93 + }, 94 + 95 + -- Configuration for breaking long messages into separate lines 96 + break_line = { 97 + -- Enable breaking messages after a specific length 98 + enabled = false, 99 + 100 + -- Number of characters after which to break the line 101 + after = 30, 102 + }, 103 + 104 + -- Custom format function for diagnostic messages 105 + -- Function receives a diagnostic object and should return a string 106 + -- Example: function(diagnostic) return diagnostic.message .. " [" .. diagnostic.source .. "]" end 107 + format = nil, 108 + 109 + -- Virtual text display configuration 110 + virt_texts = { 111 + -- Priority for virtual text display (higher values appear on top) 112 + -- Increase if other plugins (like GitBlame) override diagnostics 113 + priority = 2048, 114 + }, 115 + 116 + -- Filter diagnostics by severity levels 117 + -- Available severities: vim.diagnostic.severity.ERROR, WARN, INFO, HINT 118 + severity = { 119 + vim.diagnostic.severity.ERROR, 120 + vim.diagnostic.severity.WARN, 121 + vim.diagnostic.severity.INFO, 122 + vim.diagnostic.severity.HINT, 123 + }, 124 + 125 + -- Events to attach diagnostics to buffers 126 + -- Default: { "LspAttach" } 127 + -- Only change if the plugin doesn't work with your configuration 128 + overwrite_events = nil, 129 + }, 130 + 131 + -- List of filetypes to disable the plugin for 132 + disabled_ft = {} 133 + })
+5
modules/home-manager/shell/neovim/default.nix
··· 252 252 # config = builtins.readFile ./cfg/copilot-lua.lua; 253 253 # } 254 254 { 255 + plugin = tiny-inline-diagnostic-nvim; 256 + type = "lua"; 257 + config = builtins.readFile ./cfg/tiny-inline-diagnostics.lua; 258 + } 259 + { 255 260 plugin = nvim-lspconfig; 256 261 type = "lua"; 257 262 config = builtins.readFile ./cfg/lspconfig.lua;