feat: use ts-install.nvim to automatically install parsers

This commit is contained in:
Tomasz Wojdat 2026-03-17 20:36:59 +01:00
parent 58170c7ae3
commit 95beada08d
No known key found for this signature in database
1 changed files with 14 additions and 2 deletions

View File

@ -874,8 +874,6 @@ require('lazy').setup({
branch = 'main',
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
config = function()
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
require('nvim-treesitter').install(parsers)
vim.api.nvim_create_autocmd('FileType', {
callback = function(args)
local buf, filetype = args.buf, args.match
@ -899,6 +897,20 @@ require('lazy').setup({
})
end,
},
{ -- Automatically install Treesitter parsers for languages you encounter.
-- NOTE: This plugin is a convenience feature and is not strictly necessary for
-- regular use. If you prefer, you can remove it and install parsers manually
-- directly with treesitter using `require('nvim-treesitter').install()`.
'lewis6991/ts-install.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function()
require('ts-install').setup {
ensure_install = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
auto_install = true,
}
end,
},
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and