aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/plugins/lsp-configs.lua
blob: f9ec8f087f41df0cbc34b42e0d8287cb1f78fff5 (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
36
37
38
39
40
41
42
43
44
45
46
47
return {
  {
    "williamboman/mason.nvim",
    config = function()
      require("mason").setup()
    end
  },
  {
    "williamboman/mason-lspconfig.nvim",
    config = function()
      require("mason-lspconfig").setup({
        ensure_installed = { "lua_ls", "clangd", "crystalline", "html", "htmx", "jsonls", "ols"},
      })
    end
  },
  {
    "neovim/nvim-lspconfig",
    config = function()
      local lspconfig = require("lspconfig")
      local capabilities = require('cmp_nvim_lsp').default_capabilities()
      lspconfig.lua_ls.setup({
        capabilities = capabilities
      })
      lspconfig.clangd.setup({
        capabilities = capabilities
      })
      lspconfig.crystalline.setup({
        capabilities = capabilities
      })
      lspconfig.html.setup({
        capabilities = capabilities
      })
      lspconfig.htmx.setup({
        capabilities = capabilities
      })
      lspconfig.jsonls.setup({
        capabilities = capabilities
      })
      lspconfig.ols.setup({
        capabilities = capabilities
      })
      vim.keymap.set('n','gd', vim.lsp.buf.definition, {})
      vim.keymap.set('n','K', vim.lsp.buf.hover, {})
      vim.keymap.set({'n'},'<leader>ca', vim.lsp.buf.code_action, {})
    end
  }
}