From 15dc08f81a7976eb413f45581f4801ec495f0d98 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 11 Feb 2022 13:11:24 -0800 Subject: [PATCH] treesitter playground --- .vim/nvim.lua | 40 +++++++++++++++++++++++++++++++++------- .vimrc | 1 + 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 3246572..6bba63a 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -152,7 +152,12 @@ vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) require('lspkind').init({ -- disables text annotations --with_text = false, - with_text = true, + --with_text = true, + + -- defines how annotations are shown + -- default: symbol + -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' + mode = 'symbol', -- default symbol map -- can be either 'default' or 'codicons' @@ -264,18 +269,20 @@ require'nvim-treesitter.configs'.setup { -- One of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = { "c", - "rust", - "python", + "cpp", + "css", + "fish", "go", "javascript", - "typescript", - "markdown", - "fish", - "css", "json", "lua", "make", + "markdown", + "python", + "query", + "rust", "svelte", + "typescript", "vim", "yaml", }, @@ -303,6 +310,25 @@ require'nvim-treesitter.configs'.setup { indent = { enable = true }, + + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false, -- Whether the query persists across vim sessions + 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 = '?', + }, + } } diff --git a/.vimrc b/.vimrc index 58df56e..8962fd5 100644 --- a/.vimrc +++ b/.vimrc @@ -224,6 +224,7 @@ Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-icons' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'nvim-treesitter/playground' "Plug 'ggandor/lightspeed.nvim' Plug 'justinmk/vim-sneak'