Compare commits

..

No commits in common. "00f87db6923c696b7d561a5f817aed0dcf3dc48c" and "0e2dcbc55b8300c27ce3d0048ea9a2ba92d590ba" have entirely different histories.

View File

@ -3,7 +3,6 @@ local ensure_installed = {
'clangd', -- C/C++
'lua_ls', -- Lua
'opencl_ls', -- OpenCL
'harper_ls', -- Spelling & grammar
}
if vim.fn.executable('npm') == 1 then
@ -89,17 +88,12 @@ return {
require('cmp_nvim_lsp').default_capabilities()),
}
require('mason').setup()
require('mason-lspconfig').setup({
automatic_installation = false,
ensure_installed = ensure_installed,
})
vim.lsp.config('clangd', {
local lspconfig_custom_opts = {
clangd = {
cmd = { 'clangd', '--completion-style=detailed' },
})
},
vim.lsp.config('lua_ls', {
lua_ls = {
settings = {
Lua = {
diagnostics = {
@ -108,40 +102,28 @@ return {
},
},
},
})
},
vim.lsp.config('pyright', {
pyright = {
settings = {
pyright = {
disableOrganizeImports = true,
},
},
})
},
}
vim.lsp.config('harper_ls', {
filetypes = {}, -- Disable for all filetypes
})
-- (Dis|en)able harper-ls when spell mode is (dis|en)enabled.
vim.api.nvim_create_autocmd("OptionSet", {
pattern = "spell",
callback = function()
local bufnr = vim.api.nvim_get_current_buf()
if vim.v.option_new then
vim.lsp.start({
name = "harper_ls",
cmd = { "harper-ls", "--stdio" },
root_dir = vim.fn.getcwd(),
}, { bufnr = bufnr })
else
for _, client in pairs(vim.lsp.get_clients({ bufnr = bufnr })) do
if client.name == "harper_ls" then
vim.lsp.buf_detach_client(bufnr, client.id)
break
end
end
end
require('mason').setup()
require('mason-lspconfig').setup({
automatic_installation = false,
ensure_installed = ensure_installed,
handlers = {
function(server_name)
local opts = vim.tbl_deep_extend("force",
lspconfig_default_opts, lspconfig_custom_opts[server_name] or {})
require('lspconfig')[server_name].setup(opts)
end,
},
})
local cmp = require('cmp')