Remove lsp-zero and merge configs into one file
This commit is contained in:
parent
0cdaba658f
commit
a6e93a6d76
@ -12,14 +12,13 @@
|
||||
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "877c1db2bf957300097dd5348a665666a4d900cb" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "2c1e776fd28f001438f12b1d9cee8933a0a40934" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "0989bdf4fdf7b5aa4c74131d7ffccc3f399ac788" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "f0cd12f7a8a310c58cecebddb6b219ffad1cfd0f" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "be8d4d4cab6c13c6a572269c9d6a63774baba9a0" },
|
||||
"neogit": { "branch": "master", "commit": "93bf00cd5db1e88ea0ca9105e83f7e97896a7cd2" },
|
||||
"neogit": { "branch": "master", "commit": "760d6d74c328ce2a38b02677bf5161999b992da2" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
|
||||
"nvim-dap": { "branch": "master", "commit": "debd7c2f80eaf20c5f5df25db8d8c1b9b18f4421" },
|
||||
|
@ -56,7 +56,6 @@ require("lazy").setup({
|
||||
},
|
||||
spec = {
|
||||
{ import = "valeth.plugins" },
|
||||
{ import = "valeth.plugins.lsp" },
|
||||
{ import = "valeth.plugins.dap" },
|
||||
}
|
||||
})
|
||||
|
@ -21,6 +21,11 @@ spec.config = function()
|
||||
mode = "symbol_text",
|
||||
})
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered()
|
||||
},
|
||||
@ -32,9 +37,10 @@ spec.config = function()
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path"},
|
||||
{ name = "path" },
|
||||
})
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
return spec
|
@ -3,19 +3,53 @@ local spec = {
|
||||
}
|
||||
|
||||
spec.dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"folke/neodev.nvim",
|
||||
"mhartington/formatter.nvim",
|
||||
}
|
||||
|
||||
spec.config = function()
|
||||
-- Give me fancy diagnostic signs
|
||||
vim.fn.sign_define("DiagnosticSignError ", { text = "✘" })
|
||||
vim.fn.sign_define("DiagnosticSignWarn" , { text = "▲" })
|
||||
vim.fn.sign_define("DiagnosticSignInfo ", { text = "»" })
|
||||
vim.fn.sign_define("DiagnosticSignHint", { text = "⚑" })
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
local mason = require("mason")
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
}
|
||||
})
|
||||
|
||||
local lsp_config = require("lspconfig")
|
||||
local tsb = require("telescope.builtin")
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local autogroup = vim.api.nvim_create_augroup
|
||||
|
||||
|
||||
autocmd("LspAttach", {
|
||||
group = autogroup("LspAttachConfig", {}),
|
||||
callback = function(event)
|
||||
local tsb = require("telescope.builtin")
|
||||
local opts = { buffer = event.buf, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", tsb.lsp_definitions, opts)
|
||||
@ -34,17 +68,19 @@ spec.config = function()
|
||||
|
||||
require("neodev").setup()
|
||||
|
||||
lsp_config.lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
lsp_config.lua_ls.setup({
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
callSnippet = "Replace"
|
||||
completionItem = {
|
||||
snippetSupport = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
lsp_config.rust_analyzer.setup {
|
||||
lsp_config.rust_analyzer.setup({
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
@ -56,7 +92,7 @@ spec.config = function()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return spec
|
@ -1,39 +0,0 @@
|
||||
-- TODO: figure out how to configure auto formatting and drop lsp-zero
|
||||
local spec = {
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = "v2.x",
|
||||
}
|
||||
|
||||
spec.dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"mhartington/formatter.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
}
|
||||
|
||||
spec.config = function()
|
||||
local lsp_zero = require("lsp-zero").preset({})
|
||||
|
||||
-- NOTE: Format on save does not support async formatting
|
||||
lsp_zero.format_on_save({
|
||||
servers = {
|
||||
["rust_analyzer"] = { "rust" }
|
||||
}
|
||||
})
|
||||
|
||||
lsp_zero.setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
-- Gimme pretty icons
|
||||
lsp_zero.set_sign_icons({
|
||||
error = '✘',
|
||||
warn = '▲',
|
||||
hint = '⚑',
|
||||
info = '»'
|
||||
})
|
||||
end
|
||||
|
||||
return spec
|
@ -1,32 +0,0 @@
|
||||
local spec = {
|
||||
"williamboman/mason.nvim",
|
||||
}
|
||||
|
||||
spec.dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
}
|
||||
|
||||
spec.config = function()
|
||||
local mason = require("mason")
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return spec
|
@ -23,9 +23,9 @@ spec.config = function()
|
||||
end
|
||||
})
|
||||
|
||||
ufo.setup {
|
||||
ufo.setup({
|
||||
close_fold_kinds = {"comment", "imports"},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return spec
|
Loading…
Reference in New Issue
Block a user