config.lua 3.3 KB

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