Switch nvim-treesitter to the new `main` branch

pull/1657/head
orip 6 days ago
parent 3338d39206
commit 8a2d654ab4

@ -940,28 +940,34 @@ require('lazy').setup({
}, },
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
lazy = false,
build = ':TSUpdate', build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts branch = 'main',
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
opts = { config = function()
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
-- Autoinstall languages that are not installed require('nvim-treesitter').install(parsers)
auto_install = true,
highlight = { vim.api.nvim_create_autocmd('FileType', {
enable = true, pattern = parsers,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. callback = function()
-- If you are experiencing weird indenting issues, add the language to -- enbales syntax highlighting and other treesitter features
-- the list of additional_vim_regex_highlighting and disabled languages for indent. vim.treesitter.start()
additional_vim_regex_highlighting = { 'ruby' },
}, -- enbales treesitter based folds
indent = { enable = true, disable = { 'ruby' } }, -- for more info on folds see `:help folds`
}, -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- enables treesitter based indentation
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
end,
-- There are additional nvim-treesitter modules that you can use to interact -- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you: -- with nvim-treesitter. You should go explore a few and see what interests you:
-- --
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects (using the `main` branch)
}, },
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the

Loading…
Cancel
Save