refactor(nvim): modernize plugin stack

Removed dead weight:
- Drop nightfox, rose-pine, kanagawa, everforest colorschemes
- Remove fzf/fzf.vim (redundant with telescope)
- Remove vim-fugitive and its keymaps (lazygit covers this)
- Remove Comment.nvim (built into nvim 0.10+)

Replaced:
- nvim-cmp → blink.cmp (Rust-powered, faster, ghost text)
- none-ls/null-ls → conform.nvim (async, maintained)
- cmp-nvim-lsp capabilities → blink.cmp.get_lsp_capabilities()
- Copilot suggestions now routed through blink-copilot

Added:
- lazydev.nvim for proper Lua LSP in nvim config
- flash.nvim (s/S jump anywhere on screen)
- which-key.nvim (leader key popup with groups)
- snacks.nvim (notifier + word highlights)
- nvim-treesitter-textobjects (af/if, ac/ic, ]f/[f)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Naderer
2026-03-01 21:26:55 +01:00
parent 82fc23530d
commit 61b1e3d2a9
6 changed files with 252 additions and 191 deletions

View File

@@ -4,10 +4,6 @@ return {
{ "gruvbox-community/gruvbox", priority = 1000 },
{ "folke/tokyonight.nvim", priority = 1000 },
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
{ "EdenEast/nightfox.nvim", priority = 1000 },
{ "rose-pine/neovim", name = "rose-pine", priority = 1000 },
{ "rebelot/kanagawa.nvim", priority = 1000 },
{ "sainnhe/everforest", priority = 1000 },
-- Auto-save
@@ -73,10 +69,6 @@ return {
current_line_blame = false,
}
},
{
"tpope/vim-fugitive",
cmd = { "Git", "Gvdiffsplit" },
},
{
"kdheepak/lazygit.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
@@ -107,30 +99,70 @@ return {
right_alt = "",
space = " ",
}
-- Tokyo Night Moon colors, transparent background
vim.g.tmuxline_theme = {
a = { "#1e2030", "#82aaff" },
b = { "#82aaff", "default" },
c = { "#636da6", "default" },
x = { "#636da6", "default" },
y = { "#82aaff", "default" },
z = { "#1e2030", "#82aaff" },
win = { "#636da6", "default" },
cwin = { "#1e2030", "#c099ff" },
bg = { "#636da6", "default" },
}
vim.g.tmuxline_preset = {
a = "#S",
win = "#I #W",
a = "#S",
win = "#I #W",
cwin = "#I #W",
y = "%H:%M",
z = "%d %b",
y = "%H:%M",
z = "%d %b",
}
end,
},
-- FZF
{
"junegunn/fzf",
build = function()
vim.fn["fzf#install"]()
end,
},
{ "junegunn/fzf.vim" },
-- Productivity
{ "numToStr/Comment.nvim", event = "VeryLazy", opts = {} },
{ "windwp/nvim-autopairs", event = "InsertEnter", opts = {} },
{ "tpope/vim-surround", event = "VeryLazy" },
-- Flash: jump anywhere with 2 chars (replaces f/t for long range)
{
"folke/flash.nvim",
event = "VeryLazy",
opts = {},
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash jump" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash treesitter" },
},
},
-- Which-key: show available keybindings after leader
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
spec = {
{ "<leader>f", group = "find" },
{ "<leader>g", group = "git" },
{ "<leader>s", group = "split/spell" },
{ "<leader>w", group = "write" },
{ "<leader>d", group = "date" },
{ "<leader>l", group = "lsp" },
},
},
},
-- Snacks: notifications + quality-of-life utilities
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
notifier = { enabled = true },
words = { enabled = true },
},
},
-- -- Tmux navigation
-- { "christoomey/vim-tmux-navigator" },

View File

@@ -1,12 +1,23 @@
-- ~/.config/nvim/lua/plugins/lsp.lua
return {
-- Lazydev: proper Lua LSP for neovim config files
{
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
},
},
-- Mason (LSP installer)
{
"williamboman/mason.nvim",
build = ":MasonUpdate",
opts = {},
},
-- Mason LSP config integration
{
"williamboman/mason-lspconfig.nvim",
@@ -15,19 +26,19 @@ return {
ensure_installed = { "lua_ls", "pyright", "texlab", "bashls", "marksman" },
},
},
-- LSP configuration
{
"neovim/nvim-lspconfig",
dependencies = {
dependencies = {
"mason.nvim",
"mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"saghen/blink.cmp",
},
config = function()
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local capabilities = require("blink.cmp").get_lsp_capabilities()
local servers = { "lua_ls", "pyright", "texlab", "bashls", "marksman" }
-- Configure diagnostics to be hidden by default
vim.diagnostic.config({
virtual_text = false,
@@ -36,7 +47,7 @@ return {
update_in_insert = false,
severity_sort = false,
})
-- Set up keymaps for LSP
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
@@ -51,86 +62,80 @@ return {
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
end,
})
-- Language servers setup with capabilities
lspconfig.lua_ls.setup({
capabilities = capabilities,
})
lspconfig.pyright.setup({
capabilities = capabilities,
})
lspconfig.texlab.setup({
capabilities = capabilities,
})
lspconfig.bashls.setup({
capabilities = capabilities,
})
lspconfig.marksman.setup({
capabilities = capabilities,
})
-- Use Neovim 0.11+ LSP API to avoid deprecated lspconfig setup calls.
if vim.lsp.config and vim.lsp.enable then
for _, server in ipairs(servers) do
vim.lsp.config(server, { capabilities = capabilities })
end
vim.lsp.enable(servers)
else
local lspconfig = require("lspconfig")
for _, server in ipairs(servers) do
lspconfig[server].setup({ capabilities = capabilities })
end
end
end,
},
-- Completion
-- Copilot (suggestion/panel disabled — blink-copilot handles completions)
{
"hrsh7th/nvim-cmp",
"zbirenbaum/copilot.lua",
event = "InsertEnter",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
},
},
-- blink.cmp: fast Rust-powered completion engine
{
"saghen/blink.cmp",
version = "*",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
{
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets", "evesdropper/luasnip-latex-snippets.nvim" },
build = "make install_jsregexp",
dependencies = { "evesdropper/luasnip-latex-snippets.nvim" },
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/snippets" })
end,
},
{
"fmuaddel/blink-copilot",
dependencies = { "zbirenbaum/copilot.lua" },
},
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
-- Load snippets
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/snippets" })
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
opts = {
keymap = {
preset = "default",
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
["<CR>"] = { "accept", "fallback" },
},
appearance = { nerd_font_variant = "mono" },
sources = {
default = { "lazydev", "lsp", "path", "snippets", "buffer", "copilot" },
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100,
},
copilot = {
name = "copilot",
module = "blink-copilot",
score_offset = 50,
async = true,
},
},
mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if require("copilot.suggestion").is_visible() then
require("copilot.suggestion").accept()
elseif cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
})
end,
},
snippets = { preset = "luasnip" },
completion = {
ghost_text = { enabled = true },
},
},
},
}
}

View File

@@ -188,6 +188,6 @@ return {
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = { "nvim-tree", "fzf", "lazy" },
extensions = { "nvim-tree", "lazy" },
},
}

View File

@@ -1,28 +1,29 @@
return {
"nvimtools/none-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local null_ls = require("null-ls")
null_ls.setup({
debug = false,
sources = {
-- null_ls.builtins.diagnostics.markdownlint.with({
-- filetypes = { "markdown", "markdown.pandoc", "pandoc" },
-- }),
null_ls.builtins.formatting.prettier.with({
filetypes = { "markdown", "markdown.pandoc", "pandoc" },
}),
},
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ bufnr = bufnr })
end,
})
end
end,
})
end,
}
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<leader>fm",
function() require("conform").format({ async = true }) end,
desc = "Format buffer",
},
},
opts = {
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
json = { "prettier" },
html = { "prettier" },
css = { "prettier" },
markdown = { "prettier" },
yaml = { "prettier" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
},
}

View File

@@ -1,6 +1,8 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "c", "lua", "python", "javascript", "markdown", "markdown_inline", "html", "css", "bash", "vim", "vimdoc" },
@@ -39,6 +41,29 @@ return {
node_decremental = "grm",
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
},
},
})
-- Better folding setup
@@ -47,4 +72,5 @@ return {
vim.opt.foldlevel = 20
vim.opt.foldenable = false
end,
},
}