From 6d054a27c5d71095ffb72d5ab5c6b76f3ea52b4e Mon Sep 17 00:00:00 2001 From: Andrew Haynes Date: Mon, 2 Nov 2026 01:16:20 -0500 Subject: [PATCH] chore(ts-autotag, statusline, colorscheme, lsp): removed nvim-ts-autotag, minimized statusline, updated keymaps and lsp --- nvim/.config/nvim/colors/min-kanso.lua | 1 - .../nvim/lua/DarthMooMancer/keymaps.lua | 121 +++++++++++++----- nvim/.config/nvim/lua/DarthMooMancer/lsp.lua | 61 ++++++++- nvim/.config/nvim/lua/DarthMooMancer/opts.lua | 58 +++++---- .../nvim/lua/DarthMooMancer/plugins.lua | 15 --- .../lua/DarthMooMancer/plugins/conform.lua | 1 + .../lua/DarthMooMancer/plugins/snacks.lua | 23 ---- .../lua/DarthMooMancer/plugins/treesitter.lua | 9 +- .../nvim/lua/DarthMooMancer/plugins/vern.lua | 3 + .../nvim/lua/DarthMooMancer/statusline.lua | 74 +++-------- nvim/.config/nvim/nvim-pack-lock.json | 18 +-- 11 files changed, 205 insertions(+), 179 deletions(-) diff --git a/nvim/.config/nvim/colors/min-kanso.lua b/nvim/.config/nvim/colors/min-kanso.lua index 1f322d3..0edd109 100644 --- a/nvim/.config/nvim/colors/min-kanso.lua +++ b/nvim/.config/nvim/colors/min-kanso.lua @@ -316,7 +316,6 @@ set_highlights({ ['@comment.error'] = { fg = theme.ui.fg, bg = theme.diag.error, bold = true }, ['@comment.warning'] = { fg = theme.ui.fg_reverse, bg = theme.diag.warning, bold = true }, ['@comment.note'] = { fg = theme.ui.fg_reverse, bg = theme.diag.hint, bold = true }, - -- ['@comment.documentation'] = { link = '@tag' }, ['@markup.strong'] = { bold = true }, ['@markup.italic'] = { italic = true }, ['@markup.strikethrough'] = { strikethrough = true }, diff --git a/nvim/.config/nvim/lua/DarthMooMancer/keymaps.lua b/nvim/.config/nvim/lua/DarthMooMancer/keymaps.lua index 408877e..c04d91c 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/keymaps.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/keymaps.lua @@ -2,45 +2,108 @@ local map = vim.keymap.set map('v', 'J', ":m '>+1gv=gv") map('v', 'K', ":m '<-2gv=gv") -map('n', 'ff', function() - require('conform').format({ async = true, lsp_format = 'never' }) -end) -map('n', 'vs', ':vsplit') -map('n', 'ss', ':split') + map('n', '', 'zz') map('n', '', 'zz') map('n', 'n', 'nzzzv') map('n', 'N', 'Nzzzv') + map('x', 'p', [["_dP]]) -map('n', '', function() - Snacks.picker.files() -end) -map('n', 'fh', function() - Snacks.picker.help() -end) -map('n', 'fg', function() - Snacks.picker.grep() -end) -map('n', 'uu', function() - Snacks.picker.undo() -end) + +map('n', 'vs', ':vsplit') +map('n', 'ss', ':split') +map('n', '[', 'H', { silent = true }) +map('n', ']', 'K', { silent = true }) + +map('n', '', 'h', { silent = true }) +map('n', '', 'j', { silent = true }) +map('n', '', 'k', { silent = true }) +map('n', '', 'l', { silent = true }) map('n', 'E', ':Ex') +map('n', 'lp', 'LivePreview pick') + +map('n', '', function() + require('snacks.picker').files() +end) +map('n', 'fh', function() + require('snacks.picker').help() +end) +map('n', 'fg', function() + require('snacks.picker').grep() +end) +map('n', 'uu', function() + require('snacks.picker').undo() +end) +map('n', 'zz', function() + require('snacks.zen').zen() +end) + +map('n', 'ff', function() + require('conform').format({ async = true, lsp_format = 'never' }) +end) + map('n', 'fs', vim.lsp.buf.document_symbol) map('n', 'gd', vim.lsp.buf.definition) map('n', 'gr', vim.lsp.buf.references) map('n', 'gR', vim.lsp.buf.rename) map('n', 'gc', vim.lsp.buf.code_action) -map('n', '[', 'H', { silent = true, noremap = true }) -map('n', ']', 'K', { silent = true, noremap = true }) -map('n', 'lp', 'LivePreview pick') -map('n', '', 'NvimTmuxNavigateLeft', { silent = true }) -map('n', '', 'NvimTmuxNavigateDown', { silent = true }) -map('n', '', 'NvimTmuxNavigateUp', { silent = true }) -map('n', '', 'NvimTmuxNavigateRight', { silent = true }) + map('n', 'xx', function() - vim.diagnostic.jump({ count = 1, float = false }) -end) -map('n', 'zz', function() - Snacks.zen() -end) + local qf_open = false + for _, win in ipairs(vim.fn.getwininfo()) do + if win.quickfix == 1 then + qf_open = true + break + end + end + if qf_open then + vim.cmd('cclose') + else + vim.diagnostic.setqflist() + if #vim.fn.getqflist() == 0 then + vim.notify('No diagnostics found', vim.log.levels.WARN) + else + vim.cmd('copen') + end + end +end, { desc = 'Toggle Diagnostics Quickfix' }) + +local qf_group = vim.api.nvim_create_augroup('QuickFixDiagnostics', { clear = true }) + +vim.api.nvim_create_autocmd('DiagnosticChanged', { + group = qf_group, + callback = function() + vim.schedule(function() + local qf_open = false + for _, win in ipairs(vim.fn.getwininfo()) do + if win.quickfix == 1 then + qf_open = true + break + end + end + if qf_open then + local diagnostics = vim.diagnostic.get() + local qf_items = vim.diagnostic.toqflist(diagnostics) + vim.fn.setqflist(qf_items, 'r') + + if #qf_items == 0 then + vim.cmd('cclose') + vim.notify('No diagnostics found', vim.log.levels.WARN) + end + end + end) + end, +}) + +vim.api.nvim_create_autocmd('FileType', { + group = qf_group, + pattern = 'qf', + callback = function() + vim.schedule(function() + if vim.fn.getqflist({ size = 0 }).size == 0 then + vim.cmd('cclose') + end + end) + end, +}) diff --git a/nvim/.config/nvim/lua/DarthMooMancer/lsp.lua b/nvim/.config/nvim/lua/DarthMooMancer/lsp.lua index 5d2ee8a..bdf57dc 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/lsp.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/lsp.lua @@ -30,11 +30,61 @@ vim.lsp.config('lua_ls', { vim.lsp.config('vtsls', { settings = { + -- Control memory allocation for large TypeScript projects + vtsls = { + autoUseWorkspaceTsdk = true, + experimental = { + completion = { + enableServerSideFuzzyMatch = true, + }, + }, + }, typescript = { + -- Performance: limit automatic project scanning depth + tsserver = { + maxTsServerMemory = 8192, + }, + updateImportsOnFileMove = { enabled = 'always' }, + -- Comprehensive inlay hints configuration + inlayHints = { + parameterNames = { enabled = 'all', suppressWhenArgumentMatchesName = true }, + parameterTypes = { enabled = true }, + variableTypes = { enabled = true }, + propertyDeclarationTypes = { enabled = true }, + functionLikeReturnTypes = { enabled = true }, + enumMemberValues = { enabled = true }, + }, + -- Auto-import formatting preferences + preferences = { + importModuleSpecifier = 'non-relative', + }, + }, + -- Mirror settings for JavaScript files + javascript = { updateImportsOnFileMove = { enabled = 'always' }, inlayHints = { - parameterNames = { enabled = 'all' }, + parameterNames = { enabled = 'all', suppressWhenArgumentMatchesName = true }, + parameterTypes = { enabled = true }, variableTypes = { enabled = true }, + propertyDeclarationTypes = { enabled = true }, + functionLikeReturnTypes = { enabled = true }, + enumMemberValues = { enabled = true }, + }, + }, + }, +}) + +vim.lsp.config('rust_analyzer', { + settings = { + ['rust-analyzer'] = { + cargo = { + allFeatures = true, -- Enable all cargo features + }, + check = { + command = 'clippy', -- Use clippy for errors/warnings on save + }, + diagnostics = { + enable = true, }, }, }, @@ -44,9 +94,8 @@ vim.lsp.enable({ 'lua_ls', 'clangd', 'pylsp', - -- 'rust-analyzer', - -- 'vtsls', - -- 'tailwindcss-language-server', - -- 'cssls', - -- 'html', + 'rust_analyzer', + 'vtsls', + -- 'vscode-html-language-server', + 'superhtml', }) diff --git a/nvim/.config/nvim/lua/DarthMooMancer/opts.lua b/nvim/.config/nvim/lua/DarthMooMancer/opts.lua index 288f57f..57b10d8 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/opts.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/opts.lua @@ -1,43 +1,47 @@ -vim.opt.termguicolors = true vim.g.mapleader = ' ' -vim.opt.number = true +vim.opt.nu = true vim.opt.relativenumber = true -vim.opt.colorcolumn = '100' + +vim.opt.hlsearch = false +vim.opt.undofile = true +vim.opt.swapfile = false + +vim.opt.termguicolors = true +vim.opt.signcolumn = 'yes' +vim.opt.wrap = false +vim.opt.showmode = false +vim.o.winborder = 'rounded' + +vim.opt.scrolloff = 15 +vim.opt.sidescrolloff = 15 +vim.opt.smoothscroll = true +vim.opt.updatetime = 50 + +vim.opt.smartindent = true + local shifts = { lua = 4, python = 4, - rust = 4, - dart = 2, html = 2, javascript = 2, typescript = 2, } vim.api.nvim_create_autocmd('FileType', { + group = vim.api.nvim_create_augroup('IndentSettings', { clear = true }), pattern = vim.tbl_keys(shifts), callback = function(ev) local size = shifts[ev.match] - vim.bo[ev.buf].tabstop = size - vim.bo[ev.buf].shiftwidth = size - vim.bo[ev.buf].softtabstop = size - vim.bo[ev.buf].expandtab = true + local bo = vim.bo[ev.buf] + bo.tabstop = size + bo.shiftwidth = size + bo.softtabstop = size + bo.expandtab = true end, }) -vim.opt.wrap = false -vim.opt.swapfile = false -vim.opt.signcolumn = 'number' -vim.opt.undofile = true -- Keeps undo history even after we close a file -vim.opt.scrolloff = 15 -vim.opt.sidescrolloff = 15 -vim.opt.hlsearch = false -vim.opt.cursorline = true -- enable cursorline -vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look -vim.g.netrw_browse_split = 0 -vim.g.netrw_banner = 0 -vim.g.netrw_liststyle = 3 -vim.g.netrw_winsize = 25 -vim.opt.showmode = false -vim.opt.smoothscroll = true -vim.diagnostic.config({ severity_sort = true }) -vim.o.winborder = 'rounded' -vim.opt.updatetime = 250 + +vim.diagnostic.config({ + -- virtual_text = true, + virtual_lines = true, + severity_sort = true, +}) diff --git a/nvim/.config/nvim/lua/DarthMooMancer/plugins.lua b/nvim/.config/nvim/lua/DarthMooMancer/plugins.lua index 4b0ed5b..0a2b57a 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/plugins.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/plugins.lua @@ -2,7 +2,6 @@ vim.pack.add({ { src = 'https://github.com/folke/snacks.nvim' }, { src = 'https://github.com/nvim-mini/mini.nvim.git', version = vim.version.range('*') }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter' }, - { src = 'https://github.com/windwp/nvim-ts-autotag' }, { src = 'https://github.com/saghen/blink.cmp', version = vim.version.range('*') }, { src = 'https://github.com/folke/lazydev.nvim' }, { src = 'https://github.com/mason-org/mason.nvim' }, @@ -10,25 +9,11 @@ vim.pack.add({ { src = 'https://github.com/neovim/nvim-lspconfig' }, { src = 'https://github.com/stevearc/conform.nvim' }, { src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' }, - { src = 'https://github.com/alexghergh/nvim-tmux-navigation' }, { src = 'https://github.com/brianhuster/live-preview.nvim' }, - { src = 'https://github.com/rachartier/tiny-inline-diagnostic.nvim' }, }) vim.opt.rtp:append('/Users/andrew/personal/Projects/Lua/vern-nvim') -require('nvim-tmux-navigation').setup({ - disable_when_zoomed = true, -- defaults to false -}) -require('tiny-inline-diagnostic').setup({ - preset = 'minimal', - options = { - multilines = { - enabled = true, - always_show = true, - }, - }, -}) require('DarthMooMancer.plugins.blink-cmp') require('DarthMooMancer.plugins.mini-nvim') require('DarthMooMancer.plugins.vern') diff --git a/nvim/.config/nvim/lua/DarthMooMancer/plugins/conform.lua b/nvim/.config/nvim/lua/DarthMooMancer/plugins/conform.lua index bbc2796..5a55ce2 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/plugins/conform.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/plugins/conform.lua @@ -8,6 +8,7 @@ require('conform').setup({ c = { 'clang-format' }, cpp = { 'clang-format' }, python = { 'ruff_fix', 'ruff_format' }, + rust = { 'rustfmt' }, ['_'] = { 'trim_whitespace' }, }, format_on_save = { diff --git a/nvim/.config/nvim/lua/DarthMooMancer/plugins/snacks.lua b/nvim/.config/nvim/lua/DarthMooMancer/plugins/snacks.lua index 07abf77..7ad3ef2 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/plugins/snacks.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/plugins/snacks.lua @@ -2,37 +2,14 @@ require('snacks').setup({ notifier = { enabled = true, }, - animate = { enabled = true }, input = { enabled = true }, picker = { enabled = true, prompt = '  ', - - icons = { - ui = { - selected = ' ', - }, - }, - }, - dim = { - scope = { - min_size = 3, -- Lower minimum so short loops/branches don't get ignored - max_size = 40, -- Allow slightly larger blocks (functions/structs) to stay lit - siblings = false, -- Set to false so only the exact active scope is highlighted - }, - animate = { - enabled = vim.fn.has('nvim-0.10') == 1, - easing = 'outCubic', - duration = { - step = 15, -- ms per step - total = 180, -- maximum duration - }, - }, }, zen = { enabled = true, toggles = { - dim = true, diagnostics = true, inlay_hints = false, }, diff --git a/nvim/.config/nvim/lua/DarthMooMancer/plugins/treesitter.lua b/nvim/.config/nvim/lua/DarthMooMancer/plugins/treesitter.lua index 6f96551..d6d0e2e 100644 --- a/nvim/.config/nvim/lua/DarthMooMancer/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/DarthMooMancer/plugins/treesitter.lua @@ -4,6 +4,7 @@ local parsers = { 'c', 'cpp', 'lua', + 'html', 'javascript', 'typescript', 'tsx', @@ -14,14 +15,6 @@ local parsers = { } require('nvim-treesitter').install(parsers) -require('nvim-ts-autotag').setup({ - opts = { - enable_close = true, -- Auto close tags - enable_rename = true, -- Auto rename pairs of tags - enable_close_on_slash = false, -- Auto close on trailing 0 then - parts[#parts + 1] = ('%%#%s#%s%d%%*'):format(cfg.hl, cfg.label, n) + local nm = ' ' .. path + if ok then + local icon, hl = mini_icons.get('file', path) + if hl and hl ~= '' then + nm = ('%%#%s#%s%%* %s'):format(hl, icon or '', path) end end - local dg = #parts > 0 and (table.concat(parts, ' ') .. ' ') or '' - local clients = vim.lsp.get_clients({ bufnr = buf }) - local lsp_clients = '' - if #clients > 0 then - local names = vim.tbl_map(function(c) - return c.name - end, clients) - lsp_clients = '󰄭 ' .. table.concat(names, '/') .. ' ' - end + local dg = vim.diagnostic.status(buf) + dg = dg ~= '' and (dg .. ' ') or '' - local lsp_progress = vim.lsp.status() - local progress_str = lsp_progress ~= '' and ('%#DiagnosticInfo#' .. lsp_progress .. '%* ') or '' + local prog = vim.lsp.status() + prog = prog ~= '' and ('%#DiagnosticInfo#' .. prog .. '%* ') or '' - return nm .. '%m%r %=' .. dg .. lsp_clients .. progress_str + return string.format('%s%%m%%r %%=%s%s%%l:%%L', nm, dg, prog) end vim.opt.statusline = '%!v:lua.Status()' -local augroup = vim.api.nvim_create_augroup('CustomStatusline', { clear = true }) -vim.api.nvim_create_autocmd( - { 'DiagnosticChanged', 'LspAttach', 'LspDetach', 'BufEnter', 'LspProgress' }, - { - group = augroup, - callback = function() - vim.cmd.redrawstatus() - end, - } -) +vim.api.nvim_create_autocmd({ 'DiagnosticChanged', 'BufEnter', 'LspProgress' }, { + group = vim.api.nvim_create_augroup('CustomStatusline', { clear = true }), + callback = function() + vim.cmd.redrawstatus() + end, +}) diff --git a/nvim/.config/nvim/nvim-pack-lock.json b/nvim/.config/nvim/nvim-pack-lock.json index 4d5cc69..4967e28 100644 --- a/nvim/.config/nvim/nvim-pack-lock.json +++ b/nvim/.config/nvim/nvim-pack-lock.json @@ -22,7 +22,7 @@ "src": "https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git" }, "mason-lspconfig.nvim": { - "rev": "a338f44149f5673882c32629697d67b0c0547aec", + "rev": "cd6c64d85c9871aaf759d26f2371029d6d674a48", "src": "https://github.com/mason-org/mason-lspconfig.nvim" }, "mason.nvim": { @@ -35,32 +35,20 @@ "version": ">=0.0.0" }, "nvim-lspconfig": { - "rev": "77b7432d4770d23b277d37923e5a08a442d8bb07", + "rev": "d8d2fda7aae57030452ce8cd6e770b1eb704514e", "src": "https://github.com/neovim/nvim-lspconfig" }, - "nvim-tmux-navigation": { - "rev": "4898c98702954439233fdaf764c39636681e2861", - "src": "https://github.com/alexghergh/nvim-tmux-navigation" - }, "nvim-treesitter": { - "rev": "a2f694478be07f89c2d03cc17858a8745a400c4b", + "rev": "a9c4e1457e2e59f1b82c8f78dcdb3b2517555200", "src": "https://github.com/nvim-treesitter/nvim-treesitter" }, "nvim-ts-autotag": { "rev": "d7220b55e16ed3c04e88086256def5d282429493", "src": "https://github.com/windwp/nvim-ts-autotag" }, - "nvim-web-devicons": { - "rev": "ec309a0eaff6ea967e58c275996155ab5c16938d", - "src": "https://github.com/nvim-tree/nvim-web-devicons" - }, "snacks.nvim": { "rev": "882c996cf28183f4d63640de0b4c02ec886d01f2", "src": "https://github.com/folke/snacks.nvim" - }, - "tiny-inline-diagnostic.nvim": { - "rev": "46ae9b3c8f3039e96ff4497d190ad0aee091f30d", - "src": "https://github.com/rachartier/tiny-inline-diagnostic.nvim" } } }