config.lua 3.3 KB

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