added tree-sitter
This commit is contained in:
@@ -1 +1,2 @@
|
||||
require("romanzy.plugins.rose-pine")
|
||||
require("romanzy.plugins.nvim-treesitter")
|
||||
|
||||
56
nvim/.config/nvim/lua/romanzy/plugins/nvim-treesitter.lua
Normal file
56
nvim/.config/nvim/lua/romanzy/plugins/nvim-treesitter.lua
Normal 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,
|
||||
})
|
||||
Reference in New Issue
Block a user