From 184723dbcab48a02c938c6dff308a695f5e43c06 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 6 Mar 2024 02:08:39 -0500 Subject: [PATCH] Replace tagbar with vista --- .gitmodules | 6 +++--- init.vim | 1 - readme.md | 35 ++++++++++++++++---------------- update | 1 - vim/bundle/tagbar | 1 - vim/bundle/vista.vim | 1 + vim/config/keyboard.vim | 31 ++++++++-------------------- vim/config/plugins/lightline.vim | 23 ++++++--------------- vim/config/plugins/tagbar.vim | 12 ----------- 9 files changed, 36 insertions(+), 75 deletions(-) delete mode 160000 vim/bundle/tagbar create mode 160000 vim/bundle/vista.vim delete mode 100644 vim/config/plugins/tagbar.vim diff --git a/.gitmodules b/.gitmodules index 4eefe23..a9c6b42 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "vim/bundle/lightline.vim"] path = vim/bundle/lightline.vim url = https://github.com/itchyny/lightline.vim -[submodule "vim/bundle/tagbar"] - path = vim/bundle/tagbar - url = https://github.com/majutsushi/tagbar [submodule "vim/bundle/vim-togglelist"] path = vim/bundle/vim-togglelist url = https://github.com/milkypostman/vim-togglelist.git @@ -88,3 +85,6 @@ [submodule "vim/bundle/nvim-surround"] path = vim/bundle/nvim-surround url = https://github.com/kylechui/nvim-surround +[submodule "vim/bundle/vista.vim"] + path = vim/bundle/vista.vim + url = https://github.com/liuchengxu/vista.vim diff --git a/init.vim b/init.vim index 52d3290..26c67d5 100644 --- a/init.vim +++ b/init.vim @@ -30,7 +30,6 @@ runtime user.vim "set default values for user settings let g:autostartchecker = get(g:, "autostartchecker", 0) -let g:autostarttagbar = get(g:, "autostarttagbar", 0) let g:enabletreesitter = get(g:, "enabletreesitter", 0) let g:enablecompletion = get(g:, "enablecompletion", 0) let g:enableautotags = get(g:, "enableautotags", 0) diff --git a/readme.md b/readme.md index de74d8d..7b3fa5d 100644 --- a/readme.md +++ b/readme.md @@ -12,7 +12,7 @@ A theme, config and collection of plugins for Neovim ## Optional Requirements * **Powerline Fonts**: Required to enable the fancier looking status line -* **Universal CTags**: Required by _vim-gutentags_, _tagbar_ and optional for _nvim-cmp_ +* **Universal CTags**: Required by _vim-gutentags_, and optional for _vista_ and _nvim-cmp_ * **Compilers, Linters and Runtimes**: The _ale_ plugin can use compilers, linters and runtimes to provide real-time syntax checking ## Distribution Features @@ -33,7 +33,6 @@ A theme, config and collection of plugins for Neovim * **Configure Variables**: The following variables can be added to `local/user.vim` and have their values set to the values you require: * `g:autostartchecker`: **1** = Enable the syntax checker when a file is opened | **0** = Check syntax only after being toggled on (default: **0**) - * `g:autostarttagbar`: **1** = Load a file with the tagbar visible | **0** = Require the tagbar to be toggled on (default: **0**) * `g:enabletreesitter`: **1** = Use treesitter for compatible files | **0** = Keep treesitter disabled (default: **0**) * `g:enablecompletion`: **1** = Enable autocompletion | **0** = Disable autocompletion (default: **0**) * `g:enableautotags`: **1** = Automatically generate tags files | **0** = Disable tag generation (default: **0**) @@ -67,24 +66,24 @@ A theme, config and collection of plugins for Neovim #### Sidebars -| Binding | Mode | Action | -|-----------------|------|-----------------------------------------------| -| F11 or Leader+[ | N | Toggle git history for the current file | -| F12 or Leader+] | N | Toggle the **tagbar** source code tag sidebar | -| Leader+Leader | N | Toggle the location list for **ale** issues | +| Binding | Mode | Action | +|-----------------|------|---------------------------------------------| +| F11 or Leader+[ | N | Toggle git history for the current file | +| F12 or Leader+] | N | Toggle the **vista** symbol and tag sidebar | +| Leader+Leader | N | Toggle the location list for **ale** issues | #### Toggles -| Binding | Mode | Action | -|-----------------|------|--------------------------------------------------| -| ~ | N | Popup a command list dialog | -| | | | -| F1 | ALL | Toggle line wrapping | -| F2 | ALL | Toggle highlighting of spelling mistakes | -| F3 | ALL | Toggle external-paste mode | -| F4 | ALL | Toggle source code syntax checking | -| | | | -| \` | N | Toggle gutter (left bar with line numbers etc.) | +| Binding | Mode | Action | +|-----------------|------|-------------------------------------------------| +| ~ | N | Popup a command list dialog | +| | | | +| F1 | ALL | Toggle line wrapping | +| F2 | ALL | Toggle highlighting of spelling mistakes | +| F3 | ALL | Toggle external-paste mode | +| F4 | ALL | Toggle source code syntax checking | +| | | | +| \` | N | Toggle gutter (left bar with line numbers etc.) | #### Spell Check @@ -134,7 +133,6 @@ For a complete list of mappings specific to **darkcloud-nvimconfig**, check the * [ReplaceWithRegister](https://github.com/vim-scripts/ReplaceWithRegister): Replace text with the contents of a register (for paste+replace without writing over the buffer) * [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim): Simplifies the transition between multiline and single-line code * [tabular](https://github.com/godlygeek/tabular): Vim script for text filtering and alignment -* [tagbar](https://github.com/majutsushi/tagbar): Uses ctags to generate a sidebar of the tags for the current file * [vim-fugitive](https://github.com/tpope/vim-fugitive): A wrapper integrating git into vim in such a way as to provide features neither of them could offer on their own * [vim-gutentags](https://github.com/xolox/vim-easytags): A plugin that takes care of the much needed management of tags files in Vim * [vim-move](https://github.com/matze/vim-move): Provides a few convenient ways to move selected text @@ -143,6 +141,7 @@ For a complete list of mappings specific to **darkcloud-nvimconfig**, check the * [vim-signify](https://github.com/mhinz/vim-signify): When a version controlled file is changed, this displays a column showing where and how, and allows for navigation to and between differences * [vim-togglelist](https://github.com/milkypostman/vim-togglelist): A simple plugin for vim that allows you to bind a key to toggle the Location List and the Quickfix List * [vim-trailing-whitespace](https://github.com/bronson/vim-trailing-whitespace): Highlights and allows for the easy removal of trailing whitespace in documents +* [vista.vim](https://github.com/liuchengxu/vista.vim): Viewer & Finder for LSP symbols and tags ## Credits diff --git a/update b/update index 9e0e79d..7b80f8e 100755 --- a/update +++ b/update @@ -132,7 +132,6 @@ printf '\n%s\n' "$cbg_black ~~~ DarkCloud Neovim Config Update Tool ~~~ $c_reset if (( ! $? )); then { printf '%s\n%s\n\n' '"Auto-start syntax checking: (1:start toggled on | *0:start toggled off)' '"let g:autostartchecker = 1' - printf '%s\n%s\n\n' '"Auto-start Tagbar: (1:start open | *0:start closed)' '"let g:autostarttagbar = 1' printf '%s\n%s\n\n' '"Enable Treesitter: (1:treesitter enabled | *0:treesitter disabled)' '"let g:enabletreesitter = 1' printf '%s\n%s\n\n' '"Enable Auto-completion: (1:autocompletion enabled | *0:autocompletion disabled)' '"let g:enablecompletion = 1' printf '%s\n%s\n\n' '"Enable automatic tag generation: (1:enable tag generation | *0:disable automatic tag generation)' '"let g:enableautotags = 1' diff --git a/vim/bundle/tagbar b/vim/bundle/tagbar deleted file mode 160000 index 12edcb5..0000000 --- a/vim/bundle/tagbar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 12edcb59449b335555652898f82dd6d5c59d519a diff --git a/vim/bundle/vista.vim b/vim/bundle/vista.vim new file mode 160000 index 0000000..f76cecc --- /dev/null +++ b/vim/bundle/vista.vim @@ -0,0 +1 @@ +Subproject commit f76cecc430003968e6174cae899c2cb2953219b7 diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 6450a5b..157239b 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -95,8 +95,8 @@ " " | (N) -> toggle git commit history " [ | (N) -> toggle git commit history -" | (N) -> toggle the tagbar sidebar -" ] | (N) -> toggle the tagbar sidebar +" | (N) -> toggle the vista sidebar +" ] | (N) -> toggle the vista sidebar " | (N) -> toggle the location list " " (spellcheck) @@ -447,9 +447,9 @@ nnoremap ':vs:0Gclog:wincmd b' nnoremap [ ':vs:0Gclog:wincmd b' - "bindings to trigger the tagbar list of tags - nnoremap ':TagbarToggle:echo "tagbar toggled"' - nnoremap ] ':TagbarToggle:echo "tagbar toggled"' + "bindings to trigger the vista list of tags + nnoremap ':Vista!!' + nnoremap ] ':Vista!!' "toggle the location list nnoremap ':call ToggleLocationList()' @@ -629,23 +629,10 @@ "MAPPINGS DISABLED FOR GIVEN FILETYPES: {{{ "remove incompatible toggles from specific file types - autocmd Filetype help,tagbar,qf noremap ` - autocmd Filetype help,tagbar,qf,diff noremap - autocmd Filetype help,tagbar,qf,diff noremap - autocmd Filetype help,tagbar,qf,diff noremap - autocmd Filetype help,tagbar,qf,diff noremap } - autocmd Filetype help,qf noremap - autocmd Filetype help,qf noremap - autocmd Filetype help,qf noremap - autocmd Filetype help,qf noremap { - autocmd Filetype help,tagbar,qf noremap - autocmd Filetype help,tagbar,qf noremap - autocmd Filetype help,tagbar,qf noremap ] - autocmd Filetype help,tagbar,qf noremap - autocmd Filetype help,tagbar,qf noremap - autocmd Filetype help,tagbar,qf noremap - autocmd Filetype help,tagbar,qf noremap - autocmd Filetype help,tagbar,qf noremap [ + autocmd Filetype help,qf,diff,vista noremap + autocmd Filetype help,qf,diff,vista noremap [ + autocmd Filetype help,qf,diff noremap + autocmd Filetype help,qf,diff noremap ] "disable modifier keys with directions that would interfere with logic autocmd Filetype qf noremap diff --git a/vim/config/plugins/lightline.vim b/vim/config/plugins/lightline.vim index 1e9e8d7..ded2086 100644 --- a/vim/config/plugins/lightline.vim +++ b/vim/config/plugins/lightline.vim @@ -10,7 +10,7 @@ function! LLFilename() let fname = expand("%:t") return - \ fname == "__Tagbar__.1" ? g:lightline.fname : + \ fname == "__vista__" ? "" : \ &ft == "qf" ? "[Error/Location List]" : \ ("" != LLReadonly() ? LLReadonly() . " " : "") . \ ("" != fname ? fname : "[NEW]") . @@ -18,7 +18,7 @@ function! LLFilename() endfunction function! LLFugitive() - if expand("%:t") !~? "Tagbar" && exists("*FugitiveHead") + if expand("%:t") !~? "__vista__" && exists("*FugitiveHead") let mark = "" let _ = FugitiveHead() return strlen(_) ? mark._ : "" @@ -42,17 +42,10 @@ endfunction function! LLMode() let fname = expand("%:t") - return fname == "__Tagbar__" ? "Tagbar" : + return fname == "__vista__" ? "Vista" : \ winwidth(0) > 60 ? lightline#mode() : "" endfunction -let g:tagbar_status_func = "TagbarStatusFunc" - -function! TagbarStatusFunc(current, sort, fname, ...) abort - let g:lightline.fname = "tags" - return lightline#statusline(0) -endfunction - let g:lightline = { \ "enable": { \ "statusline": 1, @@ -60,12 +53,12 @@ let g:lightline = { \ }, \ \ "component_function": { + \ "mode": "LLMode", \ "fugitive": "LLFugitive", \ "filename": "LLFilename", \ "fileformat": "LLFileformat", - \ "filetype": "LLFiletype", \ "fileencoding": "LLFileencoding", - \ "mode": "LLMode" + \ "filetype": "LLFiletype", \ }, \ \ "component_expand": { @@ -82,12 +75,8 @@ let g:lightline = { \ "linter_ok": "left" \ }, \ - \ "component": { - \ "tagbar": "%{tagbar#currenttag('[%s]', '', 'f')}" - \ }, - \ \ "active": { - \ "left": [[ "mode", "paste" ], [ "fugitive", "filename" ], [ "tagbar" ]], + \ "left": [[ "mode", "paste" ], [ "fugitive", "filename" ]], \ "right": [[ "linter_checking", "linter_errors", "linter_warnings", "linter_ok" ], [ "fileformat", "fileencoding", "filetype" ], [ "percent", "lineinfo" ]] \ } \ } diff --git a/vim/config/plugins/tagbar.vim b/vim/config/plugins/tagbar.vim deleted file mode 100644 index 16c3075..0000000 --- a/vim/config/plugins/tagbar.vim +++ /dev/null @@ -1,12 +0,0 @@ -"start the tagbar if g:autostarttagbar is true while not in diff mode -if g:autostarttagbar == 1 && !&diff - autocmd VimEnter * nested :call tagbar#autoopen(1) -endif - -let g:tagbar_sort = 0 -let g:tagbar_compact = 1 -let g:tagbar_singleclick = 1 -let g:tagbar_width = 35 -let g:tagbar_autofocus = 1 - -autocmd FileType tagbar setlocal nocursorcolumn