Neovim plugin that integrates tree-sitter-hygen-template
to provide syntax highlighting for Hygen templates.
Hygen template with Markdown parser injected
- Syntax highlighting for Hygen templates.
- Dynamic parser injection based on file extension (see dynamic injection)
Neovim >= 0.9.0
nvim-treesitter
- Parser requirements of
tree-sitter-hygen-template
- Icon provider (optional, but recommended):
{
{
-- tree-sitter stuff
"nvim-treesitter/nvim-treesitter",
dependencies = {
-- latest commit
"Hdoc1509/hygen.nvim",
-- specific release
-- { "Hdoc1509/hygen.nvim", tag = "vX.X.X" },
-- { "Hdoc1509/hygen.nvim", version = "X.X.X" },
},
config = function()
-- NOTE: call this before calling `nvim-treesitter.configs.setup()`
require("hygen.tree-sitter").setup()
require("nvim-treesitter.configs").setup({
ensure_installed = {
-- other parsers
"bash", -- optional
"embedded_template", -- required
"javascript", -- optional
"hygen_template", -- required
},
-- other options
})
end,
},
{
-- nvim-web-devicons stuff
"nvim-tree/nvim-web-devicons",
dependencies = {
-- latest commit
"Hdoc1509/hygen.nvim",
-- specific release
-- { "Hdoc1509/hygen.nvim", tag = "vX.X.X" },
-- { "Hdoc1509/hygen.nvim", version = "X.X.X" },
},
config = function()
require("nvim-web-devicons").setup({})
require("hygen.web-devicons").setup()
end,
}
}
-- tree-sitter stuff
use {
"nvim-treesitter/nvim-treesitter",
requires = {
-- latest commit
"Hdoc1509/hygen.nvim",
-- specific release
-- { "Hdoc1509/hygen.nvim", tag = "vX.X.X" },
},
config = function()
-- NOTE: call this before calling `nvim-treesitter.configs.setup()`
require("hygen.tree-sitter").setup()
require("nvim-treesitter.configs").setup({
ensure_installed = {
-- other parsers
"bash", -- optional
"embedded_template", -- required
"javascript", -- optional
"hygen_template", -- required
},
-- other options
})
end,
}
-- nvim-web-devicons stuff
use {
"nvim-tree/nvim-web-devicons",
requires = {
-- latest commit
"Hdoc1509/hygen.nvim",
-- specific release
-- { "Hdoc1509/hygen.nvim", tag = "vX.X.X" },
},
config = function()
require("nvim-web-devicons").setup({})
require("hygen.web-devicons").setup()
end,
}
This plugin will set filetype
to hygen
to all files that match the name
pattern <file-name>.(ext).hygen
.
Note
See file name pattern convention of
tree-sitter-hygen-template
for more information.
Dynamic injection is applied to template body, based on file extension.
Target parser
to inject will be extracted from file.(ext).hygen
.
Note
See dynamic injection of
tree-sitter-hygen-template
for more information.
This plugin will follow changes of tree-sitter-hygen-template
: