dotfiles/.config/nvim/lua/plugins/treesitter.lua

26 lines
614 B
Lua

-- AST builder for parsers
-- https://github.com/nvim-treesitter/nvim-treesitter
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
auto_install = true,
highlight = {
enable = true,
is_supported = function ()
if vim.fn.strwidth(vim.fn.getline('.')) > 300
or vim.fn.getfsize(vim.fn.expand('%')) > 1024 * 1024 then
return false
else
return true
end
end
},
enable = {
enable = true,
},
})
end,
}