Replace tagbar with vista

This commit is contained in:
Kevin MacMartin 2024-03-06 02:08:39 -05:00
parent 44075669be
commit 184723dbca
9 changed files with 36 additions and 75 deletions

6
.gitmodules vendored
View file

@ -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

View file

@ -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)

View file

@ -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

1
update
View file

@ -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'

@ -1 +0,0 @@
Subproject commit 12edcb59449b335555652898f82dd6d5c59d519a

1
vim/bundle/vista.vim Submodule

@ -0,0 +1 @@
Subproject commit f76cecc430003968e6174cae899c2cb2953219b7

View file

@ -95,8 +95,8 @@
"
" <F11> | (N) -> toggle git commit history
" <Leader>[ | (N) -> toggle git commit history
" <F12> | (N) -> toggle the tagbar sidebar
" <Leader>] | (N) -> toggle the tagbar sidebar
" <F12> | (N) -> toggle the vista sidebar
" <Leader>] | (N) -> toggle the vista sidebar
" <Leader><Leader> | (N) -> toggle the location list
"
" (spellcheck)
@ -447,9 +447,9 @@
nnoremap <expr><silent> <F11> ':vs<CR>:0Gclog<CR>:wincmd b<CR>'
nnoremap <silent><expr> <Leader>[ ':vs<CR>:0Gclog<CR>:wincmd b<CR>'
"bindings to trigger the tagbar list of tags
nnoremap <silent><expr> <F12> ':TagbarToggle<CR>:echo "tagbar toggled"<CR>'
nnoremap <silent><expr> <Leader>] ':TagbarToggle<CR>:echo "tagbar toggled"<CR>'
"bindings to trigger the vista list of tags
nnoremap <silent><expr> <F12> ':Vista!!<CR>'
nnoremap <silent><expr> <Leader>] ':Vista!!<CR>'
"toggle the location list
nnoremap <silent><expr> <Leader><Leader> ':call ToggleLocationList()<CR>'
@ -629,23 +629,10 @@
"MAPPINGS DISABLED FOR GIVEN FILETYPES: {{{
"remove incompatible toggles from specific file types
autocmd Filetype help,tagbar,qf noremap <buffer> ` <Nop>
autocmd Filetype help,tagbar,qf,diff noremap <buffer> <F9> <Nop>
autocmd Filetype help,tagbar,qf,diff noremap <buffer> <C-F9> <Nop>
autocmd Filetype help,tagbar,qf,diff noremap <buffer> <A-F9> <Nop>
autocmd Filetype help,tagbar,qf,diff noremap <buffer> <Leader>} <Nop>
autocmd Filetype help,qf noremap <buffer> <F10> <Nop>
autocmd Filetype help,qf noremap <buffer> <C-F10> <Nop>
autocmd Filetype help,qf noremap <buffer> <A-F10> <Nop>
autocmd Filetype help,qf noremap <buffer> <Leader>{ <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <F11> <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <C-F11> <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <A-F11>] <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <Leader> <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <F12> <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <C-F12> <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <A-F12> <Nop>
autocmd Filetype help,tagbar,qf noremap <buffer> <Leader>[ <Nop>
autocmd Filetype help,qf,diff,vista noremap <buffer> <F11> <Nop>
autocmd Filetype help,qf,diff,vista noremap <buffer> <Leader>[ <Nop>
autocmd Filetype help,qf,diff noremap <buffer> <F12> <Nop>
autocmd Filetype help,qf,diff noremap <buffer> <Leader>] <Nop>
"disable modifier keys with directions that would interfere with logic
autocmd Filetype qf noremap <buffer> <C-Up> <Nop>

View file

@ -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" ]]
\ }
\ }

View file

@ -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