autocmds.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. -- Autocmds are automatically loaded on the VeryLazy event
  2. -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
  3. --
  4. -- Add any additional autocmds here
  5. -- with `vim.api.nvim_create_autocmd`
  6. --
  7. -- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
  8. -- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
  9. vim.api.nvim_create_autocmd("FileType", {
  10. group = vim.api.nvim_create_augroup("ziggy", {}),
  11. pattern = "ziggy",
  12. callback = function()
  13. vim.lsp.start({
  14. name = "Ziggy LSP",
  15. cmd = { "ziggy", "lsp" },
  16. root_dir = vim.loop.cwd(),
  17. flags = { exit_timeout = 1000 },
  18. })
  19. end,
  20. })
  21. vim.api.nvim_create_autocmd("FileType", {
  22. group = vim.api.nvim_create_augroup("ziggy_schema", {}),
  23. pattern = "ziggy_schema",
  24. callback = function()
  25. vim.lsp.start({
  26. name = "Ziggy LSP",
  27. cmd = { "ziggy", "lsp", "--schema" },
  28. root_dir = vim.loop.cwd(),
  29. flags = { exit_timeout = 1000 },
  30. })
  31. end,
  32. })
  33. vim.api.nvim_create_autocmd("FileType", {
  34. group = vim.api.nvim_create_augroup("superhtml", {}),
  35. pattern = "superhtml",
  36. callback = function()
  37. vim.lsp.start({
  38. name = "SuperHTML LSP",
  39. cmd = { "superhtml", "lsp" },
  40. root_dir = vim.loop.cwd(),
  41. flags = { exit_timeout = 1000 },
  42. })
  43. end,
  44. })