return { { 'nvim-treesitter/nvim-treesitter', opts = function() return require('plugins.configs.treesitter') end, config = function(_, opts) -- to ensure the configuration can happen we need to do this here -- otherwise the configuration of treesitter can't find it require('lazy').load { plugins = { 'ts-rainbow' } } require('nvim-treesitter.configs').setup(opts) end, init = function() require('core.utils.lazy')('nvim-treesitter') end, build = ':TSUpdate', dependencies = { { 'HiPhish/nvim-ts-rainbow2', name = 'ts-rainbow' }, { 'nvim-treesitter/nvim-treesitter-textobjects' }, }, }, { 'preservim/nerdcommenter', event = 'VeryLazy', init = function() vim.g.NERDSpaceDelims = 1 vim.g.NERDCompaceSexyComs = 1 end, keys = { { 'cc', nil, desc = 'Comment line' }, { 'cn', nil, desc = 'Comment line force nesting' }, { 'c', nil, desc = 'Toggle comment selection' }, { 'cm', nil, desc = 'Comment Minimal' }, { 'ci', nil, desc = 'Toggle comment line' }, { 'cs', nil, desc = 'Comment Sexy' }, { 'cy', nil, desc = 'Comment and yank' }, { 'c$', nil, desc = 'Comment to EOL' }, { 'cA', nil, desc = 'Append comment' }, { 'ca', nil, desc = 'Switch comment delimiters' }, { 'cl', nil, desc = 'Comment align left' }, { 'cb', nil, desc = 'Comment alight both' }, { 'cu', nil, desc = 'Uncomment lines' }, }, }, { 'mcauley-penney/tidy.nvim', config = true, event = 'BufWritePre', }, }