vim.lua 759 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. local M = {}
  2. M.config = function()
  3. O.lang.vim = {
  4. linters = { "vint" },
  5. lsp = {
  6. path = DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server",
  7. },
  8. }
  9. end
  10. M.format = function()
  11. -- TODO: implement formatter for language
  12. return "No formatter available!"
  13. end
  14. M.lint = function()
  15. require("lint").linters_by_ft = {
  16. vim = O.lang.vim.linters,
  17. }
  18. end
  19. M.lsp = function()
  20. if require("lv-utils").check_lsp_client_active "vimls" then
  21. return
  22. end
  23. -- npm install -g vim-language-server
  24. require("lspconfig").vimls.setup {
  25. cmd = { O.lang.vim.lsp.path, "--stdio" },
  26. on_attach = require("lsp").common_on_attach,
  27. }
  28. end
  29. M.dap = function()
  30. -- TODO: implement dap
  31. return "No DAP configured!"
  32. end
  33. return M