all repos

init.lua @ da80a74

my nvim config

init.lua/lua/configs/lsp/providers.lua(view raw)

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
48
49
50
51
52
53
---@param server Server
---@param opts table
---@return table
return function(server, opts)
  if server.name == "sumneko_lua" then
    return vim.tbl_extend(
      "force",
      opts,
      require("lua-dev").setup { lspconfig = server:get_default_options() }
    )
  end

  if server.name == "pyright" then
    return vim.tbl_extend("force", opts, {
      python = {
        disableOrganizeImports = true,
        autoSearchPaths = true,
        analysis = { useLibraryCodeForTypes = false },
      },
    })
  end

  if server.name == "gopls" then
    return vim.tbl_extend("force", opts, {
      settings = {
        gopls = {
          linksInHover = false,
          analyses = {
            unusedparams = true,
            unreachable = true,
          },
          staticcheck = true,
          memoryMode = "Normal",
        },
      },
    })
  end

  if server.name == "yamlls" then
    return vim.tbl_extend("force", opts, {
      settings = {
        yaml = {
          schemaStore = {
            enable = true,
            url = "https://www.schemastore.org/api/json/catalog.json",
          },
        },
      },
    })
  end

  return opts
end