config.lua 3.3 KB

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