summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorkiyan42 <yazdani.kiyan@protonmail.com>2020-04-22 11:13:05 +0200
committerkiyan42 <yazdani.kiyan@protonmail.com>2020-04-24 22:15:21 +0200
commit62786ec7c60ea29cbbd48ae658cde7042dba4bb3 (patch)
tree16ee7598796807d07d4e5718b777e769dec09305 /plugin
parentMerge pull request #21 from haorenW1025/master (diff)
downloadnvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.tar
nvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.tar.gz
nvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.tar.bz2
nvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.tar.lz
nvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.tar.xz
nvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.tar.zst
nvim-treesitter-62786ec7c60ea29cbbd48ae658cde7042dba4bb3.zip
feat/refacto: improve configurations
- You should now get the configs through functions - Configs for languages are now inside a local object called parsers - You can get the parser installation configurations with `get_parser_configs` - A new object has been initialized inside configs to specify module config (called config). - Provide functions to enable/disable a module on one buffer - Provide functions to enable/disable a module on all buffers, and if filetype is specified, for specific filetype - Provide function to determine if module is activated for a specified filetype
Diffstat (limited to 'plugin')
-rw-r--r--plugin/nvim-treesitter.vim17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugin/nvim-treesitter.vim b/plugin/nvim-treesitter.vim
index 06c760a18..a94f56a96 100644
--- a/plugin/nvim-treesitter.vim
+++ b/plugin/nvim-treesitter.vim
@@ -4,14 +4,17 @@ if exists('g:loaded_nvim_treesitter')
finish
endif
+augroup NvimTreesitter
+augroup END
+
+let g:loaded_nvim_treesitter = 1
+
lua << EOF
ts_installable_parsers = function()
- return table.concat(require'nvim-treesitter'.available_parsers(), '\n')
+ return table.concat(require'nvim-treesitter.configs'.available_parsers(), '\n')
+end
+ts_available_modules = function()
+ return table.concat(require'nvim-treesitter.configs'.available_modules(), '\n')
end
-require'nvim-treesitter'._root.setup()
+require'nvim-treesitter'.setup()
EOF
-
-let g:loaded_nvim_treesitter = 1
-
-augroup NvimTreesitter
-augroup END