config.lua 3.2 KB

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