Skip to content

Instantly share code, notes, and snippets.

@apraga
Created September 15, 2025 20:55
Show Gist options
  • Save apraga/46bbbbf0db159eb2bf37bab74c9259d6 to your computer and use it in GitHub Desktop.
Save apraga/46bbbbf0db159eb2bf37bab74c9259d6 to your computer and use it in GitHub Desktop.
Lazyvim for zine
return {
{
"stevearc/conform.nvim",
opts = {
formatters = {
superhtml = {
inherit = false,
command = 'superhtml',
stdin = true,
args = { 'fmt', '--stdin-super' },
},
ziggy = {
inherit = false,
command = 'ziggy',
stdin = true,
args = { 'fmt', '--stdin' },
},
ziggy_schema = {
inherit = false,
command = 'ziggy',
stdin = true,
args = { 'fmt', '--stdin-schema' },
},
},
formatters_by_ft = {
shtml = { 'superhtml' },
ziggy = { 'ziggy' },
ziggy_schema = { 'ziggy_schema' },
},
},
},
}
return {
{
"neovim/nvim-lspconfig",
opts = function(_, opts)
-- Add custom LSP autocommands
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('ziggy', {}),
pattern = 'ziggy',
callback = function()
vim.lsp.start {
name = 'Ziggy LSP',
cmd = { 'ziggy', 'lsp' },
root_dir = vim.loop.cwd(),
flags = { exit_timeout = 1000 },
}
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('ziggy_schema', {}),
pattern = 'ziggy_schema',
callback = function()
vim.lsp.start {
name = 'Ziggy LSP',
cmd = { 'ziggy', 'lsp', '--schema' },
root_dir = vim.loop.cwd(),
flags = { exit_timeout = 1000 },
}
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('superhtml', {}),
pattern = 'superhtml',
callback = function()
vim.lsp.start {
name = 'SuperHTML LSP',
cmd = { 'superhtml', 'lsp' },
root_dir = vim.loop.cwd(),
flags = { exit_timeout = 1000 },
}
end,
})
end,
},
}
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.ziggy = {
install_info = {
url = "https://github.com/kristoff-it/ziggy",
files = { "tree-sitter-ziggy/src/parser.c" },
branch = "main",
},
filetype = "ziggy",
}
parser_config.ziggy_schema = {
install_info = {
url = "https://github.com/kristoff-it/ziggy",
files = { "tree-sitter-ziggy-schema/src/parser.c" },
branch = "main",
},
filetype = "ziggy-schema",
}
parser_config.supermd = {
install_info = {
url = "https://github.com/kristoff-it/supermd",
files = {
"tree-sitter/supermd/src/parser.c",
"tree-sitter/supermd/src/scanner.c",
},
branch = "main",
},
filetype = "supermd",
}
parser_config.supermd_inline = {
install_info = {
url = "https://github.com/kristoff-it/supermd",
files = {
"tree-sitter/supermd-inline/src/parser.c",
"tree-sitter/supermd-inline/src/scanner.c",
},
branch = "main",
},
filetype = "supermd_inline",
}
parser_config.superhtml = {
install_info = {
url = "https://github.com/kristoff-it/superhtml",
files = {
"tree-sitter-superhtml/src/parser.c",
"tree-sitter-superhtml/src/scanner.c",
},
branch = "main",
},
filetype = "superhtml",
}
-- Register filetypes
vim.filetype.add {
extension = {
smd = "supermd",
shtml = "superhtml",
ziggy = "ziggy",
["ziggy-schema"] = "ziggy_schema",
},
}
-- (optional) ensure they get installed automatically
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, {
"ziggy",
"ziggy_schema",
"supermd",
"supermd_inline",
"superhtml",
})
end,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment