aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/lspconfig.lua
blob: bd748fca498ed0217a2046cdfc7c92dae6b9e760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
return {
  "neovim/nvim-lspconfig",
  event = { "BufReadPre", "BufNewFile" },
  dependencies = {
    "hrsh7th/cmp-nvim-lsp",
    { "antosha417/nvim-lsp-file-operations", config = true },
  },
  config = function()
    vim.diagnostic.config({
      update_in_insert = true,
      float = {
        focusable = false,
        style = "minimal",
        border = "rounded",
        source = "always",
        header = "",
        prefix = "",
      }
    })

    vim.diagnostic.config({ virtual_text = true })

    local lsp_configurations = require('lspconfig.configs')

    local capabilities = vim.tbl_deep_extend(
      "force",
      {},
      vim.lsp.protocol.make_client_capabilities(),
      require('cmp_nvim_lsp').default_capabilities()
    )
  end,
  vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts),
  vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts),
  vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
}