Update LSP config
This commit is contained in:
@@ -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)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
end)
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
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({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {},
|
||||
handlers = {
|
||||
lsp_zero.default_setup,
|
||||
-- For `mini.snippets` users:
|
||||
-- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert
|
||||
-- insert({ body = args.body }) -- Insert at cursor
|
||||
-- cmp.resubscribe({ "TextChangedI", "TextChangedP" })
|
||||
-- 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' },
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
-- parsing and highlighting
|
||||
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`)
|
||||
sync_install = false,
|
||||
|
||||
|
||||
@@ -96,21 +96,40 @@ return {
|
||||
|
||||
-- lsp
|
||||
|
||||
-- {
|
||||
-- 'Exafunction/windsurf.vim',
|
||||
-- event = 'BufEnter'
|
||||
-- },
|
||||
|
||||
{
|
||||
"Exafunction/codeium.vim",
|
||||
event = "BufEnter"
|
||||
"mason-org/mason.nvim",
|
||||
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()
|
||||
require("mason").setup({})
|
||||
end
|
||||
require("tiny-inline-diagnostic").setup()
|
||||
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"},
|
||||
{"hrsh7th/cmp-nvim-lsp"},
|
||||
{"hrsh7th/nvim-cmp"},
|
||||
{"L3MON4D3/LuaSnip"},
|
||||
{"hrsh7th/cmp-buffer"},
|
||||
{"hrsh7th/cmp-path"},
|
||||
{"hrsh7th/cmp-cmdline"},
|
||||
{"hrsh7th/cmp-vsnip"},
|
||||
{"hrsh7th/vim-vsnip"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user