config.lua 3.4 KB

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