diff --git a/init.lua b/init.lua index f020a12..0ff03c9 100644 --- a/init.lua +++ b/init.lua @@ -152,25 +152,40 @@ require('lazy').setup({ }, }, -{ -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - lazy = false, - build = ':TSUpdate', - config = function() - require('nvim-treesitter.configs').setup({ - ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }) - end, - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', + { -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + branch="main", + lazy = false, + build = ':TSUpdate', + -- config = function() + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + -- auto_install = true, + -- highlight = { + -- enable = true, + -- additional_vim_regex_highlighting = { 'ruby' }, + -- }, + -- indent = { enable = true, disable = { 'ruby' } }, + -- }) + -- end, + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + branch="main" + }, + init = function() + local ensureInstalled = { + 'lua', 'python', 'typescript', + -- ... your parsers + } + local alreadyInstalled = require('nvim-treesitter.config').get_installed() + local parsersToInstall = vim.iter(ensureInstalled) + :filter(function(parser) + return not vim.tbl_contains(alreadyInstalled, parser) + end) + :totable() + require('nvim-treesitter').install(parsersToInstall) + end, }, -}, -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository.