config.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. local skipped_servers = {
  2. "angularls",
  3. "ansiblels",
  4. "antlersls",
  5. "azure_pipelines_ls",
  6. "biome",
  7. "ccls",
  8. "cssmodules_ls",
  9. "custom_elements_ls",
  10. "denols",
  11. "docker_compose_language_service",
  12. "elp",
  13. "ember",
  14. "emmet_language_server",
  15. "emmet_ls",
  16. "eslint",
  17. "eslintls",
  18. "glint",
  19. "golangci_lint_ls",
  20. "gradle_ls",
  21. "graphql",
  22. "java_language_server",
  23. "jedi_language_server",
  24. "ltex",
  25. "mdx_analyzer",
  26. "neocmake",
  27. "ocamlls",
  28. "omnisharp",
  29. "phpactor",
  30. "psalm",
  31. "pylsp",
  32. "pylyzer",
  33. "pyre",
  34. "quick_lint_js",
  35. "reason_ls",
  36. "rnix",
  37. "rome",
  38. "rubocop",
  39. "ruby_ls",
  40. "ruff_lsp",
  41. "scry",
  42. "solang",
  43. "solc",
  44. "solidity_ls",
  45. "solidity_ls_nomicfoundation",
  46. "sorbet",
  47. "sourcekit",
  48. "sourcery",
  49. "spectral",
  50. "sqlls",
  51. "sqls",
  52. "standardrb",
  53. "stylelint_lsp",
  54. "svlangserver",
  55. "tflint",
  56. "unocss",
  57. "verible",
  58. "vtsls",
  59. "vuels",
  60. }
  61. local skipped_filetypes = { "markdown", "rst", "plaintext", "toml", "proto" }
  62. local join_paths = require("lvim.utils").join_paths
  63. return {
  64. templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
  65. ---@deprecated use vim.diagnostic.config({ ... }) instead
  66. diagnostics = {},
  67. document_highlight = false,
  68. code_lens_refresh = true,
  69. on_attach_callback = nil,
  70. on_init_callback = nil,
  71. automatic_configuration = {
  72. ---@usage list of servers that the automatic installer will skip
  73. skipped_servers = skipped_servers,
  74. ---@usage list of filetypes that the automatic installer will skip
  75. skipped_filetypes = skipped_filetypes,
  76. },
  77. buffer_mappings = {
  78. normal_mode = {
  79. ["K"] = { "<cmd>lua vim.lsp.buf.hover()<cr>", "Show hover" },
  80. ["gd"] = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Goto definition" },
  81. ["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<cr>", "Goto Declaration" },
  82. ["gr"] = { "<cmd>lua vim.lsp.buf.references()<cr>", "Goto references" },
  83. ["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "Goto Implementation" },
  84. ["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<cr>", "show signature help" },
  85. ["gl"] = {
  86. function()
  87. local float = vim.diagnostic.config().float
  88. if float then
  89. local config = type(float) == "table" and float or {}
  90. config.scope = "line"
  91. vim.diagnostic.open_float(config)
  92. end
  93. end,
  94. "Show line diagnostics",
  95. },
  96. },
  97. insert_mode = {},
  98. visual_mode = {},
  99. },
  100. buffer_options = {
  101. --- enable completion triggered by <c-x><c-o>
  102. omnifunc = "v:lua.vim.lsp.omnifunc",
  103. --- use gq for formatting
  104. formatexpr = "v:lua.vim.lsp.formatexpr(#{timeout_ms:500})",
  105. },
  106. ---@usage list of settings of nvim-lsp-installer
  107. installer = {
  108. setup = {
  109. ensure_installed = {},
  110. automatic_installation = {
  111. exclude = {},
  112. },
  113. },
  114. },
  115. nlsp_settings = {
  116. setup = {
  117. config_home = join_paths(get_config_dir(), "lsp-settings"),
  118. -- set to false to overwrite schemastore.nvim
  119. append_default_schemas = true,
  120. ignored_servers = {},
  121. loader = "json",
  122. },
  123. },
  124. null_ls = {
  125. setup = {
  126. debug = false,
  127. },
  128. config = {},
  129. },
  130. ---@deprecated use lvim.lsp.automatic_configuration.skipped_servers instead
  131. override = {},
  132. ---@deprecated use lvim.lsp.installer.setup.automatic_installation instead
  133. automatic_servers_installation = nil,
  134. }