config.lua 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. "vtsls",
  63. "vuels",
  64. }
  65. local skipped_filetypes = { "markdown", "rst", "plaintext", "toml", "proto" }
  66. local join_paths = require("lvim.utils").join_paths
  67. return {
  68. templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"),
  69. ---@deprecated use vim.diagnostic.config({ ... }) instead
  70. diagnostics = {},
  71. document_highlight = false,
  72. code_lens_refresh = true,
  73. on_attach_callback = nil,
  74. on_init_callback = nil,
  75. automatic_configuration = {
  76. ---@usage list of servers that the automatic installer will skip
  77. skipped_servers = skipped_servers,
  78. ---@usage list of filetypes that the automatic installer will skip
  79. skipped_filetypes = skipped_filetypes,
  80. },
  81. buffer_mappings = {
  82. normal_mode = {
  83. ["K"] = { "<cmd>lua vim.lsp.buf.hover()<cr>", "Show hover" },
  84. ["gd"] = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Goto definition" },
  85. ["gD"] = { "<cmd>lua vim.lsp.buf.declaration()<cr>", "Goto Declaration" },
  86. ["gr"] = { "<cmd>lua vim.lsp.buf.references()<cr>", "Goto references" },
  87. ["gI"] = { "<cmd>lua vim.lsp.buf.implementation()<cr>", "Goto Implementation" },
  88. ["gs"] = { "<cmd>lua vim.lsp.buf.signature_help()<cr>", "show signature help" },
  89. ["gl"] = {
  90. function()
  91. local float = vim.diagnostic.config().float
  92. if float then
  93. local config = type(float) == "table" and float or {}
  94. config.scope = "line"
  95. vim.diagnostic.open_float(config)
  96. end
  97. end,
  98. "Show line diagnostics",
  99. },
  100. },
  101. insert_mode = {},
  102. visual_mode = {},
  103. },
  104. buffer_options = {
  105. --- enable completion triggered by <c-x><c-o>
  106. omnifunc = "v:lua.vim.lsp.omnifunc",
  107. --- use gq for formatting
  108. formatexpr = "v:lua.vim.lsp.formatexpr(#{timeout_ms:500})",
  109. },
  110. ---@usage list of settings of nvim-lsp-installer
  111. installer = {
  112. setup = {
  113. ensure_installed = {},
  114. automatic_installation = {
  115. exclude = {},
  116. },
  117. },
  118. },
  119. nlsp_settings = {
  120. setup = {
  121. config_home = join_paths(get_config_dir(), "lsp-settings"),
  122. -- set to false to overwrite schemastore.nvim
  123. append_default_schemas = true,
  124. ignored_servers = {},
  125. loader = "json",
  126. },
  127. },
  128. null_ls = {
  129. setup = {
  130. debug = false,
  131. },
  132. config = {},
  133. },
  134. ---@deprecated use lvim.lsp.automatic_configuration.skipped_servers instead
  135. override = {},
  136. ---@deprecated use lvim.lsp.installer.setup.automatic_installation instead
  137. automatic_servers_installation = nil,
  138. }