diff options
author | Josh Rahm <rahm@google.com> | 2024-03-08 02:18:13 +0000 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2024-03-08 02:18:13 +0000 |
commit | e3614b2a175eafb8b89f75a907aff300a079fe08 (patch) | |
tree | 5fe7594350dfce1b7f3393d69f88db9e32d2d3cc /lua | |
parent | ca2c98e283107e6fb9244da23ab7ccaacc49269d (diff) | |
download | config.vim-e3614b2a175eafb8b89f75a907aff300a079fe08.tar.gz config.vim-e3614b2a175eafb8b89f75a907aff300a079fe08.tar.bz2 config.vim-e3614b2a175eafb8b89f75a907aff300a079fe08.zip |
Cleaned up lsp configuration. Used default configurations where needed.
Diffstat (limited to 'lua')
-rw-r--r-- | lua/lsp.lua | 122 |
1 files changed, 22 insertions, 100 deletions
diff --git a/lua/lsp.lua b/lua/lsp.lua index 93159a5..d66e5ab 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -1,71 +1,33 @@ --- CiderLSP local vim = assert(vim) --- 1. Configure CiderLSP --- Set desired filetypes from go/ciderlsp#supported --- To list all filetype names, see https://vi.stackexchange.com/a/14990 local nvim_lsp = require("lspconfig") -local configs = require("lspconfig.configs") -configs.lualsp = { - default_config = { - cmd = { "lua-language-server" }, - filetypes = { "lua" }, - settings = {}, - root_dir = nvim_lsp.util.root_pattern(""), - }, -} - -configs.clangd = { - default_config = { - cmd = { "clangd" }, - filetypes = { "c", "cpp" }, - settings = {}, - root_dir = nvim_lsp.util.root_pattern({"Makefile", "CMakeLists.txt", ""}), - }, -} - -configs.hls = { - default_config = { - cmd = { "haskell-language-server-wrapper", "--lsp" }, - filetypes = { "haskell" }, - settings = { - haskell = { - plugin = { - semanticTokens = { - globalOn = true - } +nvim_lsp.perlpls.setup {} +nvim_lsp.lua_ls.setup {} +nvim_lsp.clangd.setup {} +nvim_lsp.bashls.setup {} +nvim_lsp.rust_analyzer.setup {} +nvim_lsp.vimls.setup {} +nvim_lsp.hls.setup { + settings = { + haskell = { + plugin = { + semanticTokens = { + globalOn = true } } - }, - root_dir = nvim_lsp.util.root_pattern("package.yaml"), - } -} - -configs.pylsp = { - default_config = { - cmd = { 'pylsp' }, - filetypes = { "python" }, - settings = {}, - root_dir = nvim_lsp.util.root_pattern(""), - } -} - -configs.bash = { - default_config = { - cmd = { 'bash-language-server', 'start' }, - filetypes = { "sh", "bash", "zsh" }, - settings = {}, - root_dir = nvim_lsp.util.root_pattern(""), + } } } - -configs.rust_analyzer = { - default_config = { - cmd = { 'rust-analyzer' }, - filetypes = { 'rust' }, - settings = {}, - root_dir = nvim_lsp.util.root_pattern("Cargo.toml"), +nvim_lsp.pylsp.setup { + settings = { + pylsp = { + plugins = { + pycodestyle = { + enabled = false + } + } + } } } @@ -196,7 +158,6 @@ cmp.setup({ { name = "path" }, { name = "vim_vsnip" }, { name = "buffer", keyword_length = 5 }, - com }, sorting = { @@ -262,45 +223,6 @@ M.on_attach = function(client, bufnr) vim.opt_local.signcolumn = 'yes' end -nvim_lsp.lualsp.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = M.on_attach, -}) - -nvim_lsp.clangd.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = M.on_attach, -}) - -nvim_lsp.hls.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = M.on_attach, -}) - -nvim_lsp.pylsp.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = M.on_attach, - settings = { - pylsp = { - plugins = { - pycodestyle = { - enabled = false - } - } - } - } -}) - -nvim_lsp.bash.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = M.on_attach, -}) - -nvim_lsp.rust_analyzer.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = M.on_attach, -}) - vim.cmd[[hi DiagnosticUnderlineError gui=undercurl guisp=salmon]] vim.cmd[[hi DiagnosticUnderlineWarn gui=undercurl guisp=gold]] |