feat(setup)!: remove ensure_install field

Instead, call `require('nvim-treesitter').install( { ... } )` manually.

This gives users full control over how they want to install parsers
(sync, from grammar, limited concurrency) and obviates the need for
calling `setup` for most users.
This commit is contained in:
Christian Clason
2025-04-27 13:02:32 +02:00
parent 73adbe597e
commit 522e0c6991
7 changed files with 37 additions and 46 deletions

View File

@@ -1,13 +1,11 @@
vim.opt.runtimepath:append('.')
vim.cmd.runtime({ 'plugin/plenary.vim', bang = true })
vim.cmd.runtime({ 'plugin/nvim-treesitter.lua', bang = true })
vim.cmd.runtime({ 'plugin/query_predicates.lua', bang = true })
vim.cmd.runtime({ 'plugin/filetypes.lua', bang = true })
vim.filetype.add({
extension = {
conf = 'hocon',
hurl = 'hurl',
ncl = 'nickel',
tig = 'tiger',
w = 'wing',
@@ -17,7 +15,6 @@ vim.filetype.add({
vim.o.swapfile = false
vim.bo.swapfile = false
require('nvim-treesitter').setup()
vim.api.nvim_create_autocmd('FileType', {
callback = function(args)
pcall(vim.treesitter.start)