config.lua 3.7 KB

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