fix(hyprlang): use lazyvim way to install (#2404)

This commit is contained in:
Binh Duc Tran
2024-01-22 13:49:45 +07:00
committed by GitHub
parent eccf3b5e68
commit 1dffb1d853

View File

@ -11,25 +11,26 @@ return {
-- Add Hyprland Parser
{
"luckasRanarison/tree-sitter-hyprlang",
dependencies = {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
require("nvim-treesitter.parsers").get_parser_configs().hyprlang = {
install_info = {
url = "https://github.com/luckasRanarison/tree-sitter-hyprlang",
files = { "src/parser.c" },
branch = "master",
},
filetype = "hyprlang",
}
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "hyprlang" })
end,
},
enabled = function()
return have("hypr")
end,
event = "BufRead */hypr/*.conf",
build = ":TSUpdate hypr",
config = function()
-- Fix ft detection for hyprland
vim.filetype.add({
pattern = { [".*/hypr/.*%.conf"] = "hyprlang" },
})
require("nvim-treesitter.parsers").get_parser_configs().hyprlang = {
install_info = {
url = "https://github.com/luckasRanarison/tree-sitter-hyprlang",
files = { "src/parser.c" },
branch = "master",
},
filetype = "hypr",
}
end,
},
-- add some stuff to treesitter