added tree-sitter

This commit is contained in:
2026-06-21 23:15:03 +02:00
parent c06dc8ba3b
commit d1f5d71850
4 changed files with 85 additions and 6 deletions

View File

@@ -1 +1,2 @@
require("romanzy.plugins.rose-pine")
require("romanzy.plugins.nvim-treesitter")

View File

@@ -0,0 +1,56 @@
local parsers = {
"bash",
"c",
"gitcommit",
"javascript",
"json",
"lua",
"markdown",
"python",
"toml",
"typescript",
"vim",
"vimdoc",
"yaml",
}
local filetypes = {
"bash",
"c",
"gitcommit",
"javascript",
"json",
"lua",
"markdown",
"python",
"sh",
"toml",
"typescript",
"vim",
"vimdoc",
"yaml",
}
vim.pack.add({
{
src = "https://github.com/nvim-treesitter/nvim-treesitter",
name = "nvim-treesitter",
},
})
require("nvim-treesitter").setup({
install_dir = vim.fn.stdpath("data") .. "/site",
})
vim.treesitter.language.register("bash", { "sh" })
if vim.fn.executable("tree-sitter") == 1 then
require("nvim-treesitter").install(parsers)
end
vim.api.nvim_create_autocmd("FileType", {
pattern = filetypes,
callback = function(ev)
pcall(vim.treesitter.start, ev.buf)
end,
})