zsh.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- npm i -g bash-language-server
  2. require("lspconfig").bashls.setup {
  3. cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" },
  4. on_attach = require("lsp").common_on_attach,
  5. filetypes = { "sh", "zsh" },
  6. }
  7. -- npm i -g bash-language-server
  8. require("lspconfig").bashls.setup {
  9. cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" },
  10. on_attach = require("lsp").common_on_attach,
  11. filetypes = { "sh", "zsh" },
  12. }
  13. -- sh
  14. local sh_arguments = {}
  15. local shellcheck = {
  16. LintCommand = "shellcheck -f gcc -x",
  17. lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" },
  18. }
  19. if O.lang.sh.linter == "shellcheck" then
  20. table.insert(sh_arguments, shellcheck)
  21. end
  22. require("lspconfig").efm.setup {
  23. -- init_options = {initializationOptions},
  24. cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" },
  25. init_options = { documentFormatting = true, codeAction = false },
  26. filetypes = { "zsh" },
  27. settings = {
  28. rootMarkers = { ".git/" },
  29. languages = {
  30. sh = sh_arguments,
  31. },
  32. },
  33. }