config.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. "verible",
  36. "vuels",
  37. }
  38. local skipped_filetypes = { "markdown", "rst", "plaintext" }
  39. return {
  40. templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
  41. diagnostics = {
  42. signs = {
  43. active = true,
  44. values = {
  45. { name = "DiagnosticSignError", text = "" },
  46. { name = "DiagnosticSignWarn", text = "" },
  47. { name = "DiagnosticSignHint", text = "" },
  48. { name = "DiagnosticSignInfo", text = "" },
  49. },
  50. },
  51. virtual_text = true,
  52. update_in_insert = false,
  53. underline = true,
  54. severity_sort = true,
  55. float = {
  56. focusable = false,
  57. style = "minimal",
  58. border = "rounded",
  59. source = "always",
  60. header = "",
  61. prefix = "",
  62. format = function(d)
  63. local t = vim.deepcopy(d)
  64. local code = d.code or (d.user_data and d.user_data.lsp.code)
  65. if code then
  66. t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "")
  67. end
  68. return t.message
  69. end,
  70. },
  71. },
  72. document_highlight = true,
  73. code_lens_refresh = true,
  74. float = {
  75. focusable = true,
  76. style = "minimal",
  77. border = "rounded",
  78. },
  79. on_attach_callback = nil,
  80. on_init_callback = nil,
  81. automatic_servers_installation = true,
  82. automatic_configuration = {
  83. ---@usage list of servers that the automatic installer will skip
  84. skipped_servers = skipped_servers,
  85. ---@usage list of filetypes that the automatic installer will skip
  86. skipped_filetypes = skipped_filetypes,
  87. },
  88. buffer_mappings = {
  89. normal_mode = {
  90. ["K"] = { "<cmd>lua vim.lsp.buf.hover()<CR>", "Show hover" },
  91. ["gd"] = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Goto Definition" },
  92. ["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Goto declaration" },
  93. ["gr"] = { "<cmd>lua vim.lsp.buf.references()<CR>", "Goto references" },
  94. ["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Goto Implementation" },
  95. ["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<CR>", "show signature help" },
  96. ["gp"] = { "<cmd>lua require'lvim.lsp.peek'.Peek('definition')<CR>", "Peek definition" },
  97. ["gl"] = {
  98. "<cmd>lua require'lvim.lsp.handlers'.show_line_diagnostics()<CR>",
  99. "Show line diagnostics",
  100. },
  101. },
  102. insert_mode = {},
  103. visual_mode = {},
  104. },
  105. null_ls = {
  106. setup = {},
  107. config = {},
  108. },
  109. ---@deprecated use automatic_configuration.skipped_servers instead
  110. override = {},
  111. }