Cleanup completion plugins configuration

This commit is contained in:
Kenneth Benzie 2025-12-16 17:06:51 +00:00
parent 95d8c16621
commit ee385eb5da

View File

@ -1,54 +1,3 @@
-- Language servers
local ensure_installed = {
'clangd', -- C/C++
'lua_ls', -- Lua
'opencl_ls', -- OpenCL
'harper_ls', -- Spelling & grammar
'marksman', -- Markdown
'tinymist', -- Typst
}
if vim.fn.executable('npm') == 1 then
local ensure_install_from_npm = {
'ansiblels', -- Ansible
'bashls', -- Bash
'docker_compose_language_service', -- Docker Compose
'dockerls', -- Dockerfile
'html', -- HTML
'jsonls', -- JSON
'pyright', -- Python
'vimls', -- VimScript
'yamlls', -- YAML
}
for _, package in ipairs(ensure_install_from_npm) do
table.insert(ensure_installed, package)
end
end
if vim.fn.executable('pip') == 1 then
local ensure_install_from_pip = {
'cmake', -- CMake
'esbonio', -- Sphinx
'ruff', -- Python
}
for _, package in ipairs(ensure_install_from_pip) do
table.insert(ensure_installed, package)
end
end
if vim.fn.executable('go') == 1 then
local ensure_installed_from_go = {
'gopls', -- Go
}
for _, package in ipairs(ensure_installed_from_go) do
table.insert(ensure_installed, package)
end
end
if vim.fn.has('win32') == 1 then
table.insert(ensure_installed, 'powershell_es')
end
return { return {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
@ -131,9 +80,48 @@ return {
end end
require('mason').setup() require('mason').setup()
local language_servers = {
'clangd', -- C/C++
'lua_ls', -- Lua
'opencl_ls', -- OpenCL
'harper_ls', -- Spelling & grammar
'marksman', -- Markdown
'tinymist', -- Typst
}
if vim.fn.executable('npm') == 1 then
for _, package in ipairs({
'ansiblels', -- Ansible
'bashls', -- Bash
'docker_compose_language_service', -- Docker Compose
'dockerls', -- Dockerfile
'html', -- HTML
'jsonls', -- JSON
'pyright', -- Python
'vimls', -- VimScript
'yamlls', -- YAML
}) do table.insert(language_servers, package) end
end
if vim.fn.executable('pip') == 1 then
for _, package in ipairs({
'cmake', -- CMake
'esbonio', -- Sphinx
'ruff', -- Python
}) do table.insert(language_servers, package) end
end
if vim.fn.executable('go') == 1 then
table.insert(language_servers, 'gopls') -- Go
end
if vim.fn.has('win32') == 1 then
table.insert(language_servers, 'powershell_es') -- PowerShell
end
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
automatic_enable = true, ensure_installed = language_servers,
ensure_installed = ensure_installed,
}) })
-- (Dis|en)able harper-ls when spell mode is (dis|en)enabled. -- (Dis|en)able harper-ls when spell mode is (dis|en)enabled.
@ -266,10 +254,10 @@ return {
local mason_registry = require('mason-registry') local mason_registry = require('mason-registry')
if mason_registry.is_installed('harper-ls') then if mason_registry.is_installed('harper-ls') then
-- Disable builtin spell mode highlighting -- Disable builtin spell mode highlighting
vim.cmd.highlight('SpellBad', 'NONE') vim.cmd.highlight('SpellBad', 'NONE')
vim.cmd.highlight('SpellCap', 'NONE') vim.cmd.highlight('SpellCap', 'NONE')
vim.cmd.highlight('SpellLocal', 'NONE') vim.cmd.highlight('SpellLocal', 'NONE')
vim.cmd.highlight('SpellRare', 'NONE') vim.cmd.highlight('SpellRare', 'NONE')
end end
end end
} }