From f9b36e3d7739685052fb16bf61671d1a53b778b7 Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Tue, 8 Feb 2022 13:46:26 -0500 Subject: [PATCH] vim: Update treesitter-playground and auto-install config Ref: #32 --- nvim/lua/config/treesitter.lua | 47 +++++++++++++--------------------- vim/plugins.vim | 2 +- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/nvim/lua/config/treesitter.lua b/nvim/lua/config/treesitter.lua index 0b59f7d1..5f017f00 100644 --- a/nvim/lua/config/treesitter.lua +++ b/nvim/lua/config/treesitter.lua @@ -6,37 +6,26 @@ require'nvim-treesitter.configs'.setup { ensure_installed = "maintained", -- List of parsers to ignore installing - ignore_install = { }, - - highlight = { - -- TODO: There are many annoying issues in treesitter; - -- e.g., conflict with existing filetype-based vim syntax. - -- We disable highlight until it becomes mature enough - enable = false, - - -- List of language that will be disabled. - -- For example, some non-programming-language filetypes (e.g., fzf) should be - -- explicitly turned off otherwise it will slow down the window. - disable = { "fzf", "GV", "gitmessengerpopup", "fugitive", "NvimTree" }, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = { "python" }, + ignore_install = { + "phpdoc", -- Not compatible with M1 mac }, + playground = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '', - show_help = '?', - } + enable = true, + updatetime = 30, + keybindings = { + toggle_query_editor = 'o', + toggle_hl_groups = 'i', + toggle_injected_languages = 't', + toggle_anonymous_nodes = 'a', + toggle_language_display = 'I', + focus_language = 'f', + unfocus_language = 'F', + update = 'R', + goto_node = '', + show_help = '?', + }, + }, } -- Folding support diff --git a/vim/plugins.vim b/vim/plugins.vim index 1eaf53a0..6319db95 100644 --- a/vim/plugins.vim +++ b/vim/plugins.vim @@ -174,7 +174,7 @@ endif if has('nvim-0.6.2') " Treesitter (see ~/.config/nvim/lua/config/treesitter.lua) Plug 'nvim-treesitter/nvim-treesitter' - Plug 'nvim-treesitter/playground' + Plug 'nvim-treesitter/playground', {'as': 'nvim-treesitter-playground'} endif " Syntax, Completion, Language Servers, etc.