From b9e5e9e4ea79f0609e81624295c4f1248e3595f9 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Thu, 8 Feb 2024 21:05:50 +0100 Subject: [PATCH] vim: fix treesitter lazy loading problem --- .../nvim/lua/fschauen/plugins/treesitter.lua | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/config/nvim/lua/fschauen/plugins/treesitter.lua b/config/nvim/lua/fschauen/plugins/treesitter.lua index 3b6deed..bd53c78 100644 --- a/config/nvim/lua/fschauen/plugins/treesitter.lua +++ b/config/nvim/lua/fschauen/plugins/treesitter.lua @@ -6,27 +6,17 @@ M.dependencies = { 'nvim-treesitter/playground', } -M.event = { - 'BufReadPost', - 'BufNewFile' -} - -M.cmd = { - 'TSInstall', - 'TSUninstall', - 'TSUpdate', - 'TSUpdateSync', - 'TSInstallInfo', - 'TSInstallSync', - 'TSInstallFromGrammar', -} - M.keys = { { 'tp', 'TSPlaygroundToggle' }, { 'th', 'TSHighlightCapturesUnderCursor' }, { 'tn', 'TSNodeUnderCursor' }, } +-- When lazy loading treesitter, I get a problem when I open the first file +-- using Telescope: treesitter is used correctly in the previewer but is broken +-- afterwards. +M.lazy = false + M.config = function() require('nvim-treesitter.configs').setup { ensure_installed = {