wip plugins: refactoring
Co-Authored-by: iGor milhit <igor@milhit.ch>
parent
21bb2a4393
commit
f931dfb794
|
|
@ -1,10 +0,0 @@
|
|||
-- Install lsp-zero, to ease LSP support configuration
|
||||
-- https://lsp-zero.netlify.app
|
||||
-- https://github.com/VonHeikemen/lsp-zero.nvim/
|
||||
|
||||
return {
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = "v4.x",
|
||||
lazy = true,
|
||||
config = false,
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
-- New LSP configuration (since neovim 0.11+)
|
||||
|
||||
return {
|
||||
'mason-org/mason-lspconfig.nvim',
|
||||
dependencies = {
|
||||
'mason-org/mason.nvim',
|
||||
'neovim/nvim-lspconfig',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
},
|
||||
config = function()
|
||||
|
||||
require("mason").setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require("mason-tool-installer").setup({
|
||||
ensure_installed = {
|
||||
"prettier",
|
||||
"ruff",
|
||||
"stylua",
|
||||
"tree-sitter-cli",
|
||||
}
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"cssls",
|
||||
"html",
|
||||
"jsonls",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"ruff",
|
||||
"yamlls",
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config.marksman = {
|
||||
filetypes = { "markdown", "quarto" },
|
||||
root_dir = vim.fs.root(0, {
|
||||
".git",
|
||||
".marksman.toml",
|
||||
"._quarto.yml"
|
||||
})
|
||||
}
|
||||
|
||||
vim.lsp.config.jsonls = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require('schemastore').json.schemas(),
|
||||
validate = { enable = true },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.lsp.config('*', {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
})
|
||||
|
||||
end
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ return {
|
|||
},
|
||||
config = function()
|
||||
-- Import lsp-zero
|
||||
local lsp_zero = require("lsp-zero")
|
||||
-- local lsp_zero = require("lsp-zero")
|
||||
|
||||
-- Activate some functionalities when a LSP is activated to the current
|
||||
-- file
|
||||
|
|
@ -137,24 +137,24 @@ return {
|
|||
)
|
||||
end
|
||||
|
||||
lsp_zero.extend_lspconfig({
|
||||
-- Display diagnostic signs in the sign column
|
||||
sign_text = true,
|
||||
-- Attach the keymap function
|
||||
lsp_attach = lsp_attach,
|
||||
-- Extend the default completion capabilities by LSP suggestions
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
})
|
||||
|
||||
-- Use lsp_zero to configure interface
|
||||
lsp_zero.ui({
|
||||
float_border = "rounded",
|
||||
sign_text = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
hint = " ",
|
||||
info = " ",
|
||||
},
|
||||
})
|
||||
-- lsp_zero.extend_lspconfig({
|
||||
-- -- Display diagnostic signs in the sign column
|
||||
-- sign_text = true,
|
||||
-- -- Attach the keymap function
|
||||
-- lsp_attach = lsp_attach,
|
||||
-- -- Extend the default completion capabilities by LSP suggestions
|
||||
-- capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
-- })
|
||||
--
|
||||
-- -- Use lsp_zero to configure interface
|
||||
-- lsp_zero.ui({
|
||||
-- float_border = "rounded",
|
||||
-- sign_text = {
|
||||
-- error = " ",
|
||||
-- warn = " ",
|
||||
-- hint = " ",
|
||||
-- info = " ",
|
||||
-- },
|
||||
-- })
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,7 @@ return {
|
|||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
-- LSP to be installed by default
|
||||
-- Available LSP: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
-- LSP can be installed with :Mason
|
||||
-- But installing LSP through the following list is better
|
||||
-- https://github.com/mason-org/mason-lspconfig.nvim?tab=readme-ov-file#default-configuration
|
||||
ensure_installed = {
|
||||
"cssls",
|
||||
"html",
|
||||
|
|
@ -62,7 +59,7 @@ return {
|
|||
function(server_name)
|
||||
-- Activate all LSP from the ensure_installed list with its default
|
||||
-- configuration
|
||||
lspconfig[server_name].setup({})
|
||||
vim.lsp.enable(server_name)
|
||||
end,
|
||||
|
||||
-- Then, configure each LSP as needed
|
||||
|
|
@ -110,6 +110,7 @@ return {
|
|||
},
|
||||
},
|
||||
{ name = "path" },
|
||||
{ name = "ruff" },
|
||||
{ name = "emoji" },
|
||||
}),
|
||||
|
||||
|
|
@ -128,10 +129,13 @@ return {
|
|||
nvim_lua = "[Lua]",
|
||||
lazydev = "[Lazydev]",
|
||||
path = "[Path]",
|
||||
ruff = "[Ruff]",
|
||||
emoji = "[Emoji]",
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
|
||||
})
|
||||
|
||||
end,
|
||||
|
|
|
|||
Loading…
Reference in New Issue