22 lines
755 B
Lua
22 lines
755 B
Lua
return {
|
|
'nvim-treesitter/nvim-treesitter',
|
|
lazy = false,
|
|
build = ':TSUpdate',
|
|
config = function()
|
|
-- Auto launch for every TSInstalled filetype
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
pattern = require('nvim-treesitter').get_installed(),
|
|
callback = function(event)
|
|
-- syntax highlighting, provided by Neovim
|
|
vim.treesitter.start()
|
|
-- Use regex highlighting as well as tree-sitter
|
|
vim.bo.syntax = event.match
|
|
-- folds, provided by Neovim
|
|
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
|
vim.wo.foldmethod = 'expr'
|
|
-- indentation, provided by nvim-treesitter
|
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
|
end,
|
|
})
|
|
end
|
|
}
|