diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-03-25 23:38:13 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-03-25 23:38:13 -0500 |
commit | e6051a38a672182c7f7dfa083ca1e72b97803c94 (patch) | |
tree | 734e251bab033169399432fe1c93fc879dfab578 /nvim/lua/plugins/lspconfig.lua | |
parent | bb375ba979dfc0c575443f8309ee52d0fd446a26 (diff) |
feat: migrated to gnu stow
Diffstat (limited to 'nvim/lua/plugins/lspconfig.lua')
-rw-r--r-- | nvim/lua/plugins/lspconfig.lua | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua deleted file mode 100644 index 0635ee8..0000000 --- a/nvim/lua/plugins/lspconfig.lua +++ /dev/null @@ -1,97 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true - -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - underline = true, - signs = true, - update_in_insert = true, - virtual_text = { - true, - spacing = 6, - severity_limit='Error' -- Only show virtual text on error - }, - } -) - -local function config(_config) - return vim.tbl_deep_extend("force", { - capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()), - on_attach = function() - Nnoremap("gd", ":lua vim.lsp.buf.definition()<CR>") - Nnoremap("K", ":lua vim.lsp.buf.hover()<CR>") - Nnoremap("<leader>vws", ":lua vim.lsp.buf.workspace_symbol()<CR>") - Nnoremap("<leader>vd", ":lua vim.diagnostic.open_float()<CR>") - Nnoremap("[d", ":lua vim.lsp.diagnostic.goto_next()<CR>") - Nnoremap("]d", ":lua vim.lsp.diagnostic.goto_prev()<CR>") - Nnoremap("<leader>vca", ":lua vim.lsp.buf.code_action()<CR>") - Nnoremap("<leader>vrr", ":lua vim.lsp.buf.references()<CR>") - Nnoremap("<leader>vrn", ":lua vim.lsp.buf.rename()<CR>") - Inoremap("<C-h>", "<cmd>lua vim.lsp.buf.signature_help()<CR>") - end, - }, _config or {}) -end - -lspconfig.tsserver.setup(config()) - -lspconfig.ccls.setup(config()) - -lspconfig.gopls.setup(config({ - cmd = { "gopls", "serve" }, - settings = { - gopls = { - analyses = { - unusedparams = true, - }, - staticcheck = true, - }, - }, -})) - -local rustopts = { - tools = { - autoSetHints = true, - hover_with_actions = true, - runnables = { - use_telescope = true - }, - inlay_hints = { - show_parameter_hints = false, - parameter_hints_prefix = "", - other_hints_prefix = "", - }, - }, - server = { - settings = { - ["rust-analyzer"] = { - cargo = { - allFeatures = "true", - }, - checkOnSave = { - command = "clippy", - }, - } - } - }, -} - -require("rust-tools").setup(rustopts) - -local opts = { - -- whether to highlight the currently hovered symbol - -- disable if your cpu usage is higher than you want it - -- or you just hate the highlight - -- default: true - highlight_hovered_item = true, - - -- whether to show outline guides - -- default: true - show_guides = true, -} - -require("symbols-outline").setup(opts) |