migrate to new treesitter
This commit is contained in:
@ -3,9 +3,11 @@ return {
|
|||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
branch = 'main',
|
||||||
-- init = function(plugin)
|
-- init = function(plugin)
|
||||||
-- require("nvim-treesitter")
|
-- require("nvim-treesitter")
|
||||||
-- end,
|
-- end,
|
||||||
|
-- TODO: old options format, need to reconfigure
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { "python", "rust", "javascript" }, -- one of "all" or a list of languages
|
ensure_installed = { "python", "rust", "javascript" }, -- one of "all" or a list of languages
|
||||||
ignore_install = { "phpdoc", "comment", "rst" }, -- List of parsers to ignore installing
|
ignore_install = { "phpdoc", "comment", "rst" }, -- List of parsers to ignore installing
|
||||||
@ -34,8 +36,13 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function (_, opts)
|
config = function(_, opts)
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
-- enable treesitter highlighting
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
callback = function(args)
|
||||||
|
pcall(vim.treesitter.start, args.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user