config.lua 3.3 KB

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