feat(treesitter): add vim.treesitter.start(), enable for Lua

* Add vim.treesitter.start() for starting treesitter highlighting via
  ftplugin or autocommand (can be extended later for fold, indent,
  matchpairs, ...)
* Add vim.treesitter.stop() for manually stopping treesitter
  highlighting
* Enable treesitter highlighting for Lua if
  `vim.g.ts_highlight_lua = true` is set in `init.lua`
This commit is contained in:
Christian Clason
2022-09-05 15:52:27 +02:00
parent 97f38f0a9b
commit 0822896efc
4 changed files with 128 additions and 34 deletions

3
runtime/ftplugin/lua.lua Normal file
View File

@@ -0,0 +1,3 @@
if vim.g.ts_highlight_lua then
vim.treesitter.start()
end