update:nvim11->12 config
This commit is contained in:
50
nvim/lua/plugins/treesitter.lua
Normal file
50
nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
local M = {}
|
||||
|
||||
local pack = require("utils.pack")
|
||||
|
||||
function M.setup()
|
||||
pack.add({ "nvim-treesitter" })
|
||||
|
||||
require("nvim-treesitter").setup({
|
||||
install_dir = vim.fn.stdpath("data") .. "/site",
|
||||
})
|
||||
|
||||
require("nvim-treesitter").install({
|
||||
"lua",
|
||||
"vim",
|
||||
"python",
|
||||
"bash",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"html",
|
||||
"css",
|
||||
"json",
|
||||
"toml",
|
||||
"go",
|
||||
"astro",
|
||||
"templ",
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"lua",
|
||||
"vim",
|
||||
"python",
|
||||
"bash",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"html",
|
||||
"css",
|
||||
"json",
|
||||
"toml",
|
||||
"go",
|
||||
"astro",
|
||||
"templ",
|
||||
},
|
||||
callback = function(args)
|
||||
pcall(vim.treesitter.start, args.buf)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user