From c3b526fe51d6f4dd1dda099d69258909d0abb531 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Sun, 27 Sep 2020 12:13:11 +0200 Subject: [PATCH] feat(install): add "maintained" option to only install maintained parsers Unmaintained parsers only give users little benefit but take sometimes a a long time to install (e.g. Markdown, Julia, Haskell parser). We could recommend to only install maintained parsers by default. --- README.md | 2 +- autoload/nvim_treesitter.vim | 4 ++-- doc/nvim-treesitter.txt | 2 +- lua/nvim-treesitter/install.lua | 9 ++++++++- lua/nvim-treesitter/parsers.lua | 4 ++++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 18bce9991..060d6218b 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ so you'll need to activate them by putting this in your `init.vim` file: ```lua require'nvim-treesitter.configs'.setup { - ensure_installed = "all", -- one of "all", "language", or a list of languages + ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages highlight = { enable = true, -- false will disable the whole extension disable = { "c", "rust" }, -- list of language that will be disabled diff --git a/autoload/nvim_treesitter.vim b/autoload/nvim_treesitter.vim index a19a74708..2b02db2d8 100644 --- a/autoload/nvim_treesitter.vim +++ b/autoload/nvim_treesitter.vim @@ -7,11 +7,11 @@ function! nvim_treesitter#foldexpr() abort endfunction function! nvim_treesitter#installable_parsers(arglead, cmdline, cursorpos) abort - return join(luaeval("require'nvim-treesitter.parsers'.available_parsers()") + ['all'], "\n") + return join(luaeval("require'nvim-treesitter.parsers'.available_parsers()") + ['all', 'maintained'], "\n") endfunction function! nvim_treesitter#installed_parsers(arglead, cmdline, cursorpos) abort - return join(luaeval("require'nvim-treesitter.info'.installed_parsers()") + ['all'], "\n") + return join(luaeval("require'nvim-treesitter.info'.installed_parsers()") + ['all', 'maintained'], "\n") endfunction function! nvim_treesitter#available_modules(arglead, cmdline, cursorpos) abort diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index c8b789643..7cdc38c9a 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -36,7 +36,7 @@ To enable supported features, put this in your `init.vim` file: > lua <