config.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. local skipped_servers = {
  2. "angularls",
  3. "ansiblels",
  4. "ccls",
  5. "csharp_ls",
  6. "cssmodules_ls",
  7. "denols",
  8. "ember",
  9. "emmet_ls",
  10. "eslint",
  11. "eslintls",
  12. "golangci_lint_ls",
  13. "graphql",
  14. "jedi_language_server",
  15. "ltex",
  16. "ocamlls",
  17. "phpactor",
  18. "psalm",
  19. "pylsp",
  20. "quick_lint_js",
  21. "rome",
  22. "reason_ls",
  23. "scry",
  24. "solang",
  25. "solidity_ls",
  26. "sorbet",
  27. "sourcekit",
  28. "sourcery",
  29. "spectral",
  30. "sqlls",
  31. "sqls",
  32. "stylelint_lsp",
  33. "tailwindcss",
  34. "tflint",
  35. "svlangserver",
  36. "verible",
  37. "vuels",
  38. }
  39. local skipped_filetypes = { "markdown", "rst", "plaintext" }
  40. return {
  41. templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
  42. diagnostics = {
  43. signs = {
  44. active = true,
  45. values = {
  46. { name = "DiagnosticSignError", text = "" },
  47. { name = "DiagnosticSignWarn", text = "" },
  48. { name = "DiagnosticSignHint", text = "" },
  49. { name = "DiagnosticSignInfo", text = "" },
  50. },
  51. },
  52. virtual_text = true,
  53. update_in_insert = false,
  54. underline = true,
  55. severity_sort = true,
  56. float = {
  57. focusable = false,
  58. style = "minimal",
  59. border = "rounded",
  60. source = "always",
  61. header = "",
  62. prefix = "",
  63. format = function(d)
  64. local t = vim.deepcopy(d)
  65. local code = d.code or (d.user_data and d.user_data.lsp.code)
  66. if code then
  67. t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "")
  68. end
  69. return t.message
  70. end,
  71. },
  72. },
  73. document_highlight = true,
  74. code_lens_refresh = true,
  75. float = {
  76. focusable = true,
  77. style = "minimal",
  78. border = "rounded",
  79. },
  80. peek = {
  81. max_height = 15,
  82. max_width = 30,
  83. context = 10,
  84. },
  85. on_attach_callback = nil,
  86. on_init_callback = nil,
  87. automatic_servers_installation = true,
  88. automatic_configuration = {
  89. ---@usage list of servers that the automatic installer will skip
  90. skipped_servers = skipped_servers,
  91. ---@usage list of filetypes that the automatic installer will skip
  92. skipped_filetypes = skipped_filetypes,
  93. },
  94. buffer_mappings = {
  95. normal_mode = {
  96. ["K"] = { vim.lsp.buf.hover, "Show hover" },
  97. ["gd"] = { vim.lsp.buf.definition, "Goto Definition" },
  98. ["gD"] = { vim.lsp.buf.declaration, "Goto declaration" },
  99. ["gr"] = { vim.lsp.buf.references, "Goto references" },
  100. ["gI"] = { vim.lsp.buf.implementation, "Goto Implementation" },
  101. ["gs"] = { vim.lsp.buf.signature_help, "show signature help" },
  102. ["gp"] = {
  103. function()
  104. require("lvim.lsp.peek").Peek "definition"
  105. end,
  106. "Peek definition",
  107. },
  108. ["gl"] = {
  109. function()
  110. local config = lvim.lsp.diagnostics.float
  111. config.scope = "line"
  112. vim.diagnostic.open_float(0, config)
  113. end,
  114. "Show line diagnostics",
  115. },
  116. },
  117. insert_mode = {},
  118. visual_mode = {},
  119. },
  120. null_ls = {
  121. setup = {},
  122. config = {},
  123. },
  124. ---@deprecated use automatic_configuration.skipped_servers instead
  125. override = {},
  126. }