config.lua 3.4 KB

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