config.lua 3.4 KB

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