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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,26 +11,27 @@ return {
-- Add Hyprland Parser -- Add Hyprland Parser
{ {
"luckasRanarison/tree-sitter-hyprlang", "luckasRanarison/tree-sitter-hyprlang",
enabled = function() dependencies = {
return have("hypr") "nvim-treesitter/nvim-treesitter",
end, opts = function(_, opts)
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 = { require("nvim-treesitter.parsers").get_parser_configs().hyprlang = {
install_info = { install_info = {
url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", url = "https://github.com/luckasRanarison/tree-sitter-hyprlang",
files = { "src/parser.c" }, files = { "src/parser.c" },
branch = "master", branch = "master",
}, },
filetype = "hypr", filetype = "hyprlang",
} }
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "hyprlang" })
end, end,
}, },
enabled = function()
return have("hypr")
end,
event = "BufRead */hypr/*.conf",
},
-- add some stuff to treesitter -- add some stuff to treesitter
{ {