diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 67b8209..605c8fb 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -4,13 +4,13 @@ return { build = ':TSUpdate', config = function() -- Auto launch tree-sitter - require('nvim-treesitter').get_available() + local ts = require('nvim-treesitter') vim.api.nvim_create_autocmd('FileType', { - pattern = require('nvim-treesitter').get_available(), + pattern = ts.get_available(), callback = function(event) -- Auto install languages - if event.match ~= require('nvim-treesitter').get_installed() then - require('nvim-treesitter').install({ event.match }):wait(3000) -- 30 sec timeout + if event.match ~= ts.get_installed() then + ts.install({ event.match }):wait(30000) -- 30 sec timeout end -- syntax highlighting, provided by Neovim vim.treesitter.start()