Update LSP config

This commit is contained in:
Béla Richartz
2026-03-03 12:12:53 +01:00
parent 5fa42281f3
commit 56ba8021fd
3 changed files with 80 additions and 35 deletions

View File

@@ -1,15 +1,42 @@
local lsp_zero = require('lsp-zero') -- Set up nvim-cmp.
local cmp = require'cmp'
lsp_zero.on_attach(function(client, bufnr) cmp.setup({
-- see :help lsp-zero-keybindings snippet = {
-- to learn the available actions -- REQUIRED - you must specify a snippet engine
lsp_zero.default_keymaps({buffer = bufnr}) expand = function(args)
end) vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
require('mason').setup({}) -- For `mini.snippets` users:
require('mason-lspconfig').setup({ -- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert
ensure_installed = {}, -- insert({ body = args.body }) -- Insert at cursor
handlers = { -- cmp.resubscribe({ "TextChangedI", "TextChangedP" })
lsp_zero.default_setup, -- require("cmp.config").set_onetime({ sources = {} })
end,
}, },
}) window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})

View File

@@ -1,8 +1,7 @@
-- parsing and highlighting
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed) -- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = { "python", "bash", "yaml", "csv", "dockerfile", "go", "java", "latex", "nginx", "nix", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", },
ensure_installed = 'all',
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,

View File

@@ -96,21 +96,40 @@ return {
-- lsp -- lsp
-- {
-- 'Exafunction/windsurf.vim',
-- event = 'BufEnter'
-- },
{ {
"Exafunction/codeium.vim", "mason-org/mason.nvim",
event = "BufEnter" opts = {}
},
{
"mason-org/mason-lspconfig.nvim",
opts = {},
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"neovim/nvim-lspconfig",
},
}, },
{"williamboman/mason.nvim", {
"rachartier/tiny-inline-diagnostic.nvim",
event = "VeryLazy",
priority = 1000,
config = function() config = function()
require("mason").setup({}) require("tiny-inline-diagnostic").setup()
end vim.diagnostic.config({ virtual_text = false }) -- Disable Neovim's default virtual text diagnostics
end,
}, },
{"williamboman/mason-lspconfig.nvim"},
{"VonHeikemen/lsp-zero.nvim", branch = "v3.x"},
{"neovim/nvim-lspconfig"}, {"neovim/nvim-lspconfig"},
{"hrsh7th/cmp-nvim-lsp"}, {"hrsh7th/cmp-nvim-lsp"},
{"hrsh7th/nvim-cmp"}, {"hrsh7th/nvim-cmp"},
{"L3MON4D3/LuaSnip"}, {"hrsh7th/cmp-buffer"},
{"hrsh7th/cmp-path"},
{"hrsh7th/cmp-cmdline"},
{"hrsh7th/cmp-vsnip"},
{"hrsh7th/vim-vsnip"}
} }