all repos

init.lua @ 9649aa9576a07d74bfe7513e1da1784ba65cc575

my nvim config

init.lua/lua/configs/lsp/diagnostic.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
return function()
  local border = {
    { "", "FloatBorder" },
    { "", "FloatBorder" },
    { "", "FloatBorder" },
    { "", "FloatBorder" },
    { "", "FloatBorder" },
    { "", "FloatBorder" },
    { "", "FloatBorder" },
    { "", "FloatBorder" },
  }

  local diagnostic = {
    virtual_text = true,
    update_in_insert = false,
    underline = true,
    severity_sort = false,
    signs = {
      active = {
        { name = "DiagnosticSignError", text = "" },
        { name = "DiagnosticSignWarn", text = "" },
        { name = "DiagnosticSignHint", text = "" },
        { name = "DiagnosticSignInfo", text = "" },
      },
    },
    float = {
      focusable = true,
      style = "minimal",
      border = border,
      source = "always",
      header = "",
      prefix = "",
    },
  }

  vim.lsp.handlers["textDocument/hover"] =
    vim.lsp.with(vim.lsp.handlers.hover, {
      border = border,
    })

  vim.diagnostic.config(diagnostic)
  for _, sign in ipairs(diagnostic.signs.active) do
    vim.fn.sign_define(sign.name, {
      texthl = sign.name,
      text = sign.text,
      numhl = "",
    })
  end
end