From 11cbe8c259856578f90d673717737df4ac80e87e Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Sat, 20 Dec 2025 20:43:38 +0800 Subject: [PATCH] nvim: modernize and optimize neovim configuration Update deprecated LSP server names, fix API calls, and resolve plugin conflicts to improve configuration maintainability and performance. Changes include: - Replace deprecated tsserver with ts_ls in LSP configuration The nvim-lspconfig project renamed tsserver to ts_ls following upstream changes. This update ensures compatibility with current and future versions. - Fix treesitter API call from config to configs The correct API is nvim-treesitter.configs, not .config. This fixes potential runtime errors during treesitter initialization. - Resolve completion plugin conflict between nvim-cmp and blink.cmp Disable nvim-cmp configuration as blink.cmp is already configured and active. Running both completion engines simultaneously causes conflicts and degrades performance. - Replace symbols-outline.nvim with aerial.nvim The symbols-outline plugin is no longer actively maintained. Aerial.nvim provides similar functionality with better performance and active maintenance. - Remove redundant cmdheight setting in options.lua The cmdheight option was set twice. Keep only the modern value of 0 and remove the outdated conditional check for nvim-0.8. - Enable matchparen in disabled_plugins list Modern alternatives like vim-matchup provide better functionality. Disabling the built-in matchparen reduces startup overhead. - Update dashboard header from DEVASLIFE to M1NGSAMA Personalize the neovim startup screen with custom branding. These changes bring the configuration up to date with current best practices, eliminate deprecated APIs, and improve overall performance and maintainability. Signed-off-by: m1ngsama --- nvim/lua/config/lazy.lua | 2 +- nvim/lua/config/options.lua | 6 ++---- nvim/lua/plugins/coding.lua | 27 ++++++++++++++++----------- nvim/lua/plugins/lsp.lua | 2 +- nvim/lua/plugins/treesitter.lua | 2 +- nvim/lua/plugins/ui.lua | 12 ++++++------ 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 014aa3b..ef0710c 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -66,7 +66,7 @@ require("lazy").setup({ disabled_plugins = { "gzip", -- "matchit", - -- "matchparen", + "matchparen", -- using vim-matchup or other alternatives "netrwPlugin", "rplugin", "tarPlugin", diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 218f64d..e7337dc 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -11,7 +11,6 @@ vim.opt.smartindent = true vim.opt.hlsearch = true vim.opt.backup = false vim.opt.showcmd = true -vim.opt.cmdheight = 1 vim.opt.laststatus = 3 vim.opt.expandtab = true vim.opt.scrolloff = 10 @@ -42,6 +41,5 @@ vim.opt.formatoptions:append({ "r" }) vim.cmd([[au BufNewFile,BufRead *.astro setf astro]]) vim.cmd([[au BufNewFile,BufRead Podfile setf ruby]]) -if vim.fn.has("nvim-0.8") == 1 then - vim.opt.cmdheight = 0 -end +-- Modern Neovim (0.8+) supports cmdheight = 0 +vim.opt.cmdheight = 0 diff --git a/nvim/lua/plugins/coding.lua b/nvim/lua/plugins/coding.lua index f1133f4..0be9642 100644 --- a/nvim/lua/plugins/coding.lua +++ b/nvim/lua/plugins/coding.lua @@ -78,20 +78,25 @@ return { end, }, + -- Use aerial.nvim instead of symbols-outline (more actively maintained) { - "simrat39/symbols-outline.nvim", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - cmd = "SymbolsOutline", + "stevearc/aerial.nvim", + keys = { { "cs", "AerialToggle", desc = "Symbols Outline (Aerial)" } }, + cmd = "AerialToggle", opts = { - position = "right", + layout = { + default_direction = "right", + }, + attach_mode = "global", }, }, - { - "nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, + -- Disabled: using blink.cmp instead + -- { + -- "nvim-cmp", + -- dependencies = { "hrsh7th/cmp-emoji" }, + -- opts = function(_, opts) + -- table.insert(opts.sources, { name = "emoji" }) + -- end, + -- }, } diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index f2aee3d..d034c1f 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -30,7 +30,7 @@ return { return require("lspconfig.util").root_pattern(".git")(...) end, }, - tsserver = { + ts_ls = { root_dir = function(...) return require("lspconfig.util").root_pattern(".git")(...) end, diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index d11c9fb..f3443d2 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -53,7 +53,7 @@ return { }, }, config = function(_, opts) - require("nvim-treesitter.config").setup(opts) + require("nvim-treesitter.configs").setup(opts) -- MDX vim.filetype.add({ diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua index 692fd8f..4106de4 100644 --- a/nvim/lua/plugins/ui.lua +++ b/nvim/lua/plugins/ui.lua @@ -156,12 +156,12 @@ return { dashboard = { preset = { header = [[ - ██████╗ ███████╗██╗ ██╗ █████╗ ███████╗██╗ ██╗███████╗███████╗ - ██╔══██╗██╔════╝██║ ██║██╔══██╗██╔════╝██║ ██║██╔════╝██╔════╝ - ██║ ██║█████╗ ██║ ██║███████║███████╗██║ ██║█████╗ █████╗ - ██║ ██║██╔══╝ ╚██╗ ██╔╝██╔══██║╚════██║██║ ██║██╔══╝ ██╔══╝ - ██████╔╝███████╗ ╚████╔╝ ██║ ██║███████║███████╗██║██║ ███████╗ - ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚═╝ ╚══════╝ + ███╗ ███╗ ██╗███╗ ██╗ ██████╗ ███████╗ █████╗ ███╗ ███╗ █████╗ + ████╗ ████║███║████╗ ██║██╔════╝ ██╔════╝██╔══██╗████╗ ████║██╔══██╗ + ██╔████╔██║╚██║██╔██╗ ██║██║ ███╗███████╗███████║██╔████╔██║███████║ + ██║╚██╔╝██║ ██║██║╚██╗██║██║ ██║╚════██║██╔══██║██║╚██╔╝██║██╔══██║ + ██║ ╚═╝ ██║ ██║██║ ╚████║╚██████╔╝███████║██║ ██║██║ ╚═╝ ██║██║ ██║ + ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ]], }, },