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>
142 lines
4.0 KiB
Lua
142 lines
4.0 KiB
Lua
-- ~/.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",
|
|
dependencies = { "mason.nvim" },
|
|
opts = {
|
|
ensure_installed = { "lua_ls", "pyright", "texlab", "bashls", "marksman" },
|
|
},
|
|
},
|
|
|
|
-- LSP configuration
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
dependencies = {
|
|
"mason.nvim",
|
|
"mason-lspconfig.nvim",
|
|
"saghen/blink.cmp",
|
|
},
|
|
config = function()
|
|
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,
|
|
signs = false,
|
|
underline = false,
|
|
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", {}),
|
|
callback = function(ev)
|
|
local opts = { buffer = ev.buf }
|
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
|
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
|
|
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, opts)
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
|
end,
|
|
})
|
|
|
|
-- 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,
|
|
},
|
|
|
|
-- Copilot (suggestion/panel disabled — blink-copilot handles completions)
|
|
{
|
|
"zbirenbaum/copilot.lua",
|
|
event = "InsertEnter",
|
|
opts = {
|
|
suggestion = { enabled = false },
|
|
panel = { enabled = false },
|
|
},
|
|
},
|
|
|
|
-- blink.cmp: fast Rust-powered completion engine
|
|
{
|
|
"saghen/blink.cmp",
|
|
version = "*",
|
|
dependencies = {
|
|
"rafamadriz/friendly-snippets",
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
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" },
|
|
},
|
|
},
|
|
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,
|
|
},
|
|
},
|
|
},
|
|
snippets = { preset = "luasnip" },
|
|
completion = {
|
|
ghost_text = { enabled = true },
|
|
},
|
|
},
|
|
},
|
|
}
|