From 95beada08d0ca3d3e7a5ee3c042e53c5ca5c8927 Mon Sep 17 00:00:00 2001 From: Tomasz Wojdat Date: Tue, 17 Mar 2026 20:36:59 +0100 Subject: [PATCH 1/2] feat: use ts-install.nvim to automatically install parsers --- init.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index ed50b69d7f3..33500baa97e 100644 --- a/init.lua +++ b/init.lua @@ -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 From 66e732b7ea8b69c98439f472c3587ad81aad80fd Mon Sep 17 00:00:00 2001 From: Tomasz Wojdat Date: Fri, 20 Mar 2026 15:14:13 +0100 Subject: [PATCH 2/2] Define `ensure_installed` and allow to extend it by the user --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 33500baa97e..db34d08f21e 100644 --- a/init.lua +++ b/init.lua @@ -905,8 +905,12 @@ require('lazy').setup({ 'lewis6991/ts-install.nvim', dependencies = { 'nvim-treesitter/nvim-treesitter' }, config = function() + local ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + vim.list_extend(ensure_installed, { + -- You can add other parsers here that you want to be always installed + }) require('ts-install').setup { - ensure_install = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_install = ensure_installed, auto_install = true, } end,