From 47bb74f7ada1ac338c1509994cd7e837a59f1456 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 30 Jan 2022 11:27:25 +0530 Subject: add ts playground, remove git from statusline --- init.vim | 2 +- lua/treesitter.lua | 25 ++++++++++++++++++++++++- plugin/statusline.vim | 16 ---------------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/init.vim b/init.vim index 1923a48..697d6b2 120000 --- a/init.vim +++ b/init.vim @@ -1 +1 @@ -/nix/store/rfv8sgqc8mhpyyzb6j71k6gmgps03cc9-home-manager-files/.config/nvim/init.vim \ No newline at end of file +/nix/store/fc1p35ipvnxslsrj09rzs51zlbc431ad-home-manager-files/.config/nvim/init.vim \ No newline at end of file diff --git a/lua/treesitter.lua b/lua/treesitter.lua index 5027de5..344abf0 100644 --- a/lua/treesitter.lua +++ b/lua/treesitter.lua @@ -14,5 +14,28 @@ require'nvim-treesitter.configs'.setup { }, indent = { enable = false - } + }, + 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 = '?', + }, + }, + query_linter = { + enable = true, + use_virtual_text = true, + lint_events = {"BufWrite", "CursorHold"}, + }, } diff --git a/plugin/statusline.vim b/plugin/statusline.vim index d1f7d05..a5264a4 100644 --- a/plugin/statusline.vim +++ b/plugin/statusline.vim @@ -39,20 +39,6 @@ hi User9 ctermfg=00 ctermbg=0 highlight EndOfBuffer ctermfg=black ctermbg=black -function! GitBranch() - return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") -endfunction - -function! TreesitterStatus() - let l:status = nvim_treesitter#statusline(90) - return (status == "null")? "" : status -endfunction - -function! StatuslineGit() - let l:branchname = GitBranch() - return strlen(l:branchname) > 0?l:branchname.' ':'' -endfunction - function! ReadOnly() abort if !&modifiable && &readonly return ' RO' @@ -119,8 +105,6 @@ function! StatusLine(mode) abort " active if a:mode ==# 'active' - let l:line.='%7*%{StatuslineGit()}' - let l:line.='%<' let l:line.=Filepath() let l:line.='%5*' let l:line.=QuickFixStatus() -- cgit v1.2.3