config.lua 3.6 KB

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