diff options
author | Akshay <[email protected]> | 2022-01-30 05:57:25 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-01-30 05:57:25 +0000 |
commit | 47bb74f7ada1ac338c1509994cd7e837a59f1456 (patch) | |
tree | cfa32cdbcd8de076ff9d871e2208fdd43bafc67c | |
parent | a35a4e7aae127b4ca3346b15ef6822f5f7583363 (diff) |
add ts playground, remove git from statusline
l--------- | init.vim | 2 | ||||
-rw-r--r-- | lua/treesitter.lua | 25 | ||||
-rw-r--r-- | plugin/statusline.vim | 16 |
3 files changed, 25 insertions, 18 deletions
@@ -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 { | |||
14 | }, | 14 | }, |
15 | indent = { | 15 | indent = { |
16 | enable = false | 16 | enable = false |
17 | } | 17 | }, |
18 | playground = { | ||
19 | enable = true, | ||
20 | disable = {}, | ||
21 | updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code | ||
22 | persist_queries = false, -- Whether the query persists across vim sessions | ||
23 | keybindings = { | ||
24 | toggle_query_editor = 'o', | ||
25 | toggle_hl_groups = 'i', | ||
26 | toggle_injected_languages = 't', | ||
27 | toggle_anonymous_nodes = 'a', | ||
28 | toggle_language_display = 'I', | ||
29 | focus_language = 'f', | ||
30 | unfocus_language = 'F', | ||
31 | update = 'R', | ||
32 | goto_node = '<cr>', | ||
33 | show_help = '?', | ||
34 | }, | ||
35 | }, | ||
36 | query_linter = { | ||
37 | enable = true, | ||
38 | use_virtual_text = true, | ||
39 | lint_events = {"BufWrite", "CursorHold"}, | ||
40 | }, | ||
18 | } | 41 | } |
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 | |||
39 | 39 | ||
40 | highlight EndOfBuffer ctermfg=black ctermbg=black | 40 | highlight EndOfBuffer ctermfg=black ctermbg=black |
41 | 41 | ||
42 | function! GitBranch() | ||
43 | return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") | ||
44 | endfunction | ||
45 | |||
46 | function! TreesitterStatus() | ||
47 | let l:status = nvim_treesitter#statusline(90) | ||
48 | return (status == "null")? "" : status | ||
49 | endfunction | ||
50 | |||
51 | function! StatuslineGit() | ||
52 | let l:branchname = GitBranch() | ||
53 | return strlen(l:branchname) > 0?l:branchname.' ':'' | ||
54 | endfunction | ||
55 | |||
56 | function! ReadOnly() abort | 42 | function! ReadOnly() abort |
57 | if !&modifiable && &readonly | 43 | if !&modifiable && &readonly |
58 | return ' RO' | 44 | return ' RO' |
@@ -119,8 +105,6 @@ function! StatusLine(mode) abort | |||
119 | 105 | ||
120 | " active | 106 | " active |
121 | if a:mode ==# 'active' | 107 | if a:mode ==# 'active' |
122 | let l:line.='%7*%{StatuslineGit()}' | ||
123 | let l:line.='%<' | ||
124 | let l:line.=Filepath() | 108 | let l:line.=Filepath() |
125 | let l:line.='%5*' | 109 | let l:line.='%5*' |
126 | let l:line.=QuickFixStatus() | 110 | let l:line.=QuickFixStatus() |