2023-10-08 13:45:54 +02:00
|
|
|
---@type string
|
|
|
|
local xdg_config = vim.env.XDG_CONFIG_HOME or vim.env.HOME .. "/.config"
|
|
|
|
|
|
|
|
---@param path string
|
|
|
|
local function have(path)
|
|
|
|
return vim.loop.fs_stat(xdg_config .. "/" .. path) ~= nil
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
-- Add Hyprland Parser
|
|
|
|
{
|
2024-01-20 12:50:34 +01:00
|
|
|
"luckasRanarison/tree-sitter-hyprlang",
|
2024-01-22 13:49:45 +07:00
|
|
|
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,
|
|
|
|
},
|
2023-10-13 12:31:32 +02:00
|
|
|
enabled = function()
|
|
|
|
return have("hypr")
|
|
|
|
end,
|
2023-10-08 13:45:54 +02:00
|
|
|
event = "BufRead */hypr/*.conf",
|
|
|
|
},
|
|
|
|
|
|
|
|
-- add some stuff to treesitter
|
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
|
|
|
opts = function(_, opts)
|
|
|
|
local function add(lang)
|
2023-10-17 16:33:55 +02:00
|
|
|
if type(opts.ensure_installed) == "table" then
|
2023-10-08 13:45:54 +02:00
|
|
|
table.insert(opts.ensure_installed, lang)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
vim.filetype.add({
|
|
|
|
extension = { rasi = "rasi" },
|
|
|
|
pattern = {
|
|
|
|
[".*/waybar/config"] = "jsonc",
|
|
|
|
[".*/mako/config"] = "dosini",
|
|
|
|
[".*/kitty/*.conf"] = "bash",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
add("git_config")
|
|
|
|
|
|
|
|
if have("fish") then
|
|
|
|
add("fish")
|
|
|
|
end
|
|
|
|
|
|
|
|
if have("rofi") or have("wofi") then
|
|
|
|
add("rasi")
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|