Add jj/kitty/nvim/opencode/paru/fish/yazi/jjui
This commit is contained in:
39
nvim/files/lua/plugins/treesitter.lua
Normal file
39
nvim/files/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
return {
|
||||
-- Highlight, edit, and navigate code
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter").setup({
|
||||
install_dir = vim.fn.stdpath("data") .. "/site",
|
||||
})
|
||||
|
||||
-- Install parsers (async, no-op if already installed)
|
||||
require("nvim-treesitter").install({
|
||||
"vimdoc",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"ripple",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"jsdoc",
|
||||
"bash",
|
||||
"svelte",
|
||||
"astro",
|
||||
"vue",
|
||||
"css",
|
||||
"scss",
|
||||
"gdscript",
|
||||
})
|
||||
|
||||
-- Enable treesitter highlighting and indentation
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user