2024-01-17 13:01:32 +01:00
|
|
|
return {
|
|
|
|
'nvim-treesitter/nvim-treesitter',
|
2024-01-21 16:25:54 +01:00
|
|
|
dependencies = {"luckasRanarison/tree-sitter-hyprlang"},
|
2024-01-17 13:01:32 +01:00
|
|
|
build = ":TSUpdate",
|
|
|
|
opts = {
|
2024-01-21 12:24:56 +01:00
|
|
|
ensure_installed = { "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline" },
|
2024-01-17 13:01:32 +01:00
|
|
|
auto_install = true,
|
|
|
|
highlight = {
|
|
|
|
enable = true,
|
|
|
|
additional_vim_regex_highlighting = false,
|
|
|
|
disable = function(lang, buf) -- Disable if file size is too big
|
|
|
|
if lang == "ini" or lang == "markdown" then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
local max_filesize = 2000 * 1024 -- 2MB
|
|
|
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
|
|
|
if ok and stats and stats.size > max_filesize then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
indent = {
|
|
|
|
enable = true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
config = function (_, opts)
|
2024-01-18 00:57:56 +01:00
|
|
|
require("nvim-treesitter.configs").setup(opts)
|
2024-01-21 16:25:54 +01:00
|
|
|
vim.filetype.add({
|
|
|
|
pattern = { [".*/hyprland%.conf"] = "hyprlang" },
|
|
|
|
})
|
2024-01-17 13:01:32 +01:00
|
|
|
end
|
|
|
|
}
|