From c8e845b3c79f1f334362a49b21102c42f3ae047c Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 15 Apr 2022 01:04:33 -0400 Subject: [PATCH] Fix up the keybindings for the location list, remove a bunch of unnecessary/unused bindings, remove vim-extradite (which no longer seems to be maintained and isn't compatible with the latest fugitive) and attempt to recreate it to an extent using vim-fugitive directly --- .gitmodules | 3 - README.md | 13 +- vim/bundle/vim-extradite | 1 - vim/config/keyboard.vim | 248 ++++++++++--------------------- vim/config/plugins/lightline.vim | 1 - 5 files changed, 85 insertions(+), 181 deletions(-) delete mode 160000 vim/bundle/vim-extradite diff --git a/.gitmodules b/.gitmodules index 7b86fb1..797e65a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -103,6 +103,3 @@ [submodule "vim/bundle/neco-syntax"] path = vim/bundle/neco-syntax url = https://github.com/Shougo/neco-syntax.git -[submodule "vim/bundle/vim-extradite"] - path = vim/bundle/vim-extradite - url = https://github.com/tap349/vim-extradite diff --git a/README.md b/README.md index b9cc839..8bab726 100644 --- a/README.md +++ b/README.md @@ -98,12 +98,12 @@ As usual, to have your system use `vimpager` in place of `less`, you'll need to #### Sidebars #### -| Binding | Mode | Action | -|----------------------|------|-----------------------------------------------| -| F9 and Backslash+} | ALL | Toggle the **extradite** git history window | -| F10 and Backslash+{ | ALL | Toggle the **tagbar** source code tag sidebar | -| F12 and Backslash+\[ | ALL | Toggle **vimfiler** file manager sidebar | -| Backslash+Backslash | N | Toggle the location list for **ale** issues | +| Binding | Mode | Action | +|------------|----------|-----------------------------------------------| +| F9 or \+} | ALL or N | Toggle git history for the current file | +| F10 or \+{ | ALL or N | Toggle the **tagbar** source code tag sidebar | +| F11 or \+\ | ALL or N | Toggle the location list for **ale** issues | +| F12 or \+[ | ALL or N | Toggle **vimfiler** file manager sidebar | #### Toggles #### @@ -176,7 +176,6 @@ For a complete list of mappings specific to **darkcloud-vimconfig**, check the l * [tcomment_vim](https://github.com/tomtom/tcomment_vim): File-type sensible comments that can be easily toggled on and off for blocks of text. * [vim-easytags](https://github.com/xolox/vim-easytags): Automated tag file generation and syntax highlighting of tags in Vim. * [vim-misc](https://github.com/xolox/vim-misc): Miscellaneous auto-load Vim scripts required by vim-easytags. -* [vim-extradite-tap349](https://github.com/tap349/vim-extradite): A git commit browser extending vim-fugitive that displays differences and optionally loads old revisions. * [vimfiler.vim](https://github.com/Shougo/vimfiler.vim): A curses-style file manager for vim that runs on it's own or in a sidebar and can associate handlers for file types. * [unite.vim](https://github.com/Shougo/unite.vim): A library used by Vim Filer to help build its user interface. * [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. diff --git a/vim/bundle/vim-extradite b/vim/bundle/vim-extradite deleted file mode 160000 index 83fdb41..0000000 --- a/vim/bundle/vim-extradite +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 83fdb410ec5b70421a6882485bf317f0eaf513c2 diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 1371a21..2fd3431 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -93,31 +93,19 @@ " _ | (N) -> unopen all folds " 0 | (N) -> reset all folds using default fold level " -" | (A) -> toggle extradite git commit history -" | (A) -> toggle extradite git commit history -" | (A) -> toggle extradite git commit history -" } | (N) -> toggle extradite git commit history -" | (A) -> toggle the tagbar sidebar -" | (A) -> toggle the tagbar sidebar -" | (A) -> toggle the tagbar sidebar -" { | (N) -> toggle the tagbar sidebar -" | (A) -> toggle vimfiler sidebar -" | (A) -> toggle vimfiler sidebar -" | (A) -> toggle vimfiler sidebar -" [ | (N) -> toggle vimfiler sidebar -" " | (A) -> toggle line wrapping -" | (A) -> toggle line wrapping -" | (A) -> toggle line wrapping " | (A) -> toggle spell check -" | (A) -> toggle spell check -" | (A) -> toggle spell check " | (A) -> toggle external-paste mode -" | (A) -> toggle external-paste mode -" | (A) -> toggle external-paste mode " | (A) -> toggle syntax checking -" | (A) -> toggle syntax checking -" | (A) -> toggle syntax checking +" +" | (A) -> toggle git commit history +" } | (N) -> toggle git commit history +" | (A) -> toggle the tagbar sidebar +" { | (N) -> toggle the tagbar sidebar +" | (A) -> toggle the location list +" | (N) -> toggle the location list +" | (A) -> toggle vimfiler sidebar +" [ | (N) -> toggle vimfiler sidebar " " (gvim toggles) " | (A) -> toggle the menubar @@ -136,7 +124,7 @@ " p | (V) -> preserve the buffer pasting over selected text " Y | (N) -> copy to the end of the line " -" (delete/cut functions) +" (delete/cut operations that don't replace the paste buffer) " x | (N) -> delete the char(s) under and the cursor " x | (V) -> delete the currently selected text " X | (N) -> delete the char(s) before the cursor @@ -147,18 +135,6 @@ " dd | (N) -> delete current line " d | (V) -> delete selected text " -" (improved copy and paste shortcuts) -" | (N) -> paste from buffer -" | (V) -> paste buffer in place of selection -" | (I) -> paste from buffer then return to input -" | (N) -> copy character -" | (V) -> copy selection -" | (N) -> cut character -" | (V) -> cut selection -" | (I) -> cut previous word during input -" | (I) -> cut line before cursor during input -" | (I) -> paste what's been cut during input -" " (fixing-and-formatting) " J | (N) -> split document into lines of tw or 80 " J | (V) -> split selection into lines of tw or 80 @@ -230,30 +206,24 @@ " | (V) -> select one word left " "Filetype Specific Mappings: -" (extradite) -" | (A) -> close the dialog -" | (A) -> close the dialog -" | (A) -> same as down -" l | (A) -> same as j -" | (A) -> same as Up -" h | (A) -> same as k -" " (help) " q | (A) -> close the dialog " ? | (A) -> close the dialog " ?> | (A) -> close the dialog " ?< | (A) -> close the dialog " -" (qf sidebar mappings) -" | (A) -> left click + left justify the cursor -" | (A) -> same as the left click -" | (A) -> same as the left click -" | (A) -> select entry -" | (A) -> select entry but remain in qf sidebar +" (markdown) +" f | (N) -> format a table +" f | (V) -> format a table +" +" (error/location list) " | (A) -> up " | (A) -> down -" h | (A) -> j " l | (A) -> k +" h | (A) -> j +" | (A) -> select entry +" | (A) -> select entry but remain in qf sidebar +" q | (A) -> close the list " " (vimdiff) " <> | (N) -> update differences @@ -299,8 +269,6 @@ "ALIASES: COMMAND SHORTCUTS {{{ "shortcuts to git commands - cabbrev GitLog ':Extradite:wincmd x:wincmd j:resize 10' - cabbrev gitlog ':Extradite:wincmd x:wincmd j:resize 10' cabbrev GitDiff ':Gdiff' cabbrev gitdiff ':Gdiff' cabbrev GitStatus ':Gstatus' @@ -558,9 +526,6 @@ nmap k ':execute "setlocal iskeyword+=".getline(".")[col(".")-1]:echo "The character ".getline(".")[col(".")-1]." has been added to iskeyword"' nmap K ':execute "setlocal iskeyword-=".getline(".")[col(".")-1]:echo "The character ".getline(".")[col(".")-1]." has been removed from iskeyword"' - "toggle the location list - nnoremap ':call ToggleLocationList()' - "toggle the command reference box nnoremap ~ ':TCommand' @@ -587,63 +552,15 @@ "reset all folds to the default fold level nnoremap 0 'zX:echo "all folds have been reset"' - "view commit history and diffs - nnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - xnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - inoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - nnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - xnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - inoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - nnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - xnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - inoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - nnoremap } ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - - "bindings to trigger the tagbar list of tags - nnoremap ':TagbarToggle:echo "tagbar toggled"' - xnoremap ':TagbarTogglegv' - inoremap ':TagbarToggle' - nnoremap ':TagbarToggle:echo "tagbar toggled"' - xnoremap ':TagbarTogglegv' - inoremap ':TagbarToggle' - nnoremap ':TagbarToggle:echo "tagbar toggled"' - xnoremap ':TagbarTogglegv' - inoremap ':TagbarToggle' - nnoremap { ':TagbarToggle:echo "tagbar toggled"' - - "trigger vimfiler - nnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - xnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - inoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - nnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - xnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - inoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - nnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - xnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - inoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - nnoremap [ ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - "toggle line wrapping (and bottom bar if using the gui) nnoremap ':set wrap!:echo "line wrapping toggled"' xnoremap ':set wrap!gv' inoremap ':set wrap!' - nnoremap ':set wrap!:echo "line wrapping toggled"' - xnoremap ':set wrap!gv' - inoremap ':set wrap!' - nnoremap ':set wrap!:echo "line wrapping toggled"' - xnoremap ':set wrap!gv' - inoremap ':set wrap!' "toggle show spelling errors nnoremap ':set spell!:if &spell =~ "0"echo "spellcheck toggled off"elseecho "spellcheck toggled on"endif' xnoremap ':set spell!gv' inoremap ':set spell!' - nnoremap ':set spell!:if &spell =~ "0"echo "spellcheck toggled off"elseecho "spellcheck toggled on"endif' - xnoremap ':set spell!gv' - inoremap ':set spell!' - nnoremap ':set spell!:if &spell =~ "0"echo "spellcheck toggled off"elseecho "spellcheck toggled on"endif' - xnoremap ':set spell!gv' - inoremap ':set spell!' "toggle external-paste mode set pastetoggle= @@ -662,12 +579,30 @@ nnoremap ':call ToggleAle()' xnoremap ':call ToggleAle()gv' inoremap ':call ToggleAle()' - nnoremap ':call ToggleAle()' - xnoremap ':call ToggleAle()gv' - inoremap ':call ToggleAle()' - nnoremap ':call ToggleAle()' - xnoremap ':call ToggleAle()gv' - inoremap ':call ToggleAle()' + + "view commit history and diffs + nnoremap ':vs:0Gclog:wincmd b' + xnoremap ':vs:0Gclog:wincmd b' + inoremap ':vs:0Gclog:wincmd b' + nnoremap } ':vs:0Gclog:wincmd b' + + "bindings to trigger the tagbar list of tags + nnoremap ':TagbarToggle:echo "tagbar toggled"' + xnoremap ':TagbarTogglegv' + inoremap ':TagbarToggle' + nnoremap { ':TagbarToggle:echo "tagbar toggled"' + + "toggle the location list + nnoremap ':call ToggleLocationList()' + xnoremap ':call ToggleLocationList()' + inoremap ':call ToggleLocationList()' + nnoremap ':call ToggleLocationList()' + + "trigger vimfiler + nnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' + xnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' + inoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' + nnoremap [ ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' "} "GVIM TOGGLES:{ @@ -712,7 +647,7 @@ "copy to the end of the line nnoremap Y vg_y - "Alternatives to cut/deletion commands that don't replace the buffer + "delete/cut operations that don't replace the paste buffer nnoremap x "_x vnoremap x "_x nnoremap X "_X @@ -722,18 +657,6 @@ nnoremap dd "_dd nnoremap dw "_dw vnoremap d "_d - - "map copy/paste shortcuts to more typical ones - nnoremap P - xmap ReplaceWithRegisterVisual - inoremap p - nnoremap vy - vnoremap y - nnoremap x - vnoremap x - inoremap db - inoremap d0 - inoremap " "} "FIXING AND FORMATTING:{ @@ -862,16 +785,6 @@ "}}} "FILETYPE SPECIFIC MAPPINGS: {{{ - "extradite - autocmd FileType extradite map - autocmd FileType extradite map l j - autocmd FileType extradite map - autocmd FileType extradite map h k - autocmd FileType extradite map q - autocmd FileType extradite map q - autocmd FileType extradite map q - autocmd FileType extradite map } q - "help if !&diff autocmd FileType help map q ':q' @@ -883,17 +796,14 @@ autocmd FileType markdown nnoremap f ':TableFormat' autocmd FileType markdown xnoremap f ':TableFormatgv' - "qf-sidebar - autocmd FileType qf map 0 - autocmd FileType qf map - autocmd FileType qf map - autocmd FileType qf map <2-LeftMouse> - autocmd FileType qf map p + "error/location list autocmd FileType qf map autocmd FileType qf map - autocmd FileType qf map h j - autocmd FileType qf map l k - autocmd FileType qf map q ':call ToggleQuickfixList()' + autocmd FileType qf map l j + autocmd FileType qf map h k + autocmd FileType qf map <2-LeftMouse> + autocmd FileType qf map p + autocmd FileType qf if getwininfo(win_getid())[0]['loclist'] == 0|map q ':call ToggleQuickfixList()'|else|map q ':call ToggleLocationList()'|endif "vimdiff autocmd FilterWritePre * if &diff|nmap <> ':diffu'|endif @@ -918,47 +828,47 @@ "MAPPINGS DISABLED FOR GIVEN FILETYPES: {{{ "remove incompatible toggles from specific file types - autocmd Filetype extradite,help,tagbar,qf,vimfiler noremap ` + autocmd Filetype help,tagbar,qf,vimfiler noremap ` autocmd Filetype help,tagbar,qf,vimfiler,diff noremap autocmd Filetype help,tagbar,qf,vimfiler,diff noremap autocmd Filetype help,tagbar,qf,vimfiler,diff noremap autocmd Filetype help,tagbar,qf,vimfiler,diff noremap } - autocmd Filetype extradite,help,qf,vimfiler noremap - autocmd Filetype extradite,help,qf,vimfiler noremap - autocmd Filetype extradite,help,qf,vimfiler noremap - autocmd Filetype extradite,help,qf,vimfiler noremap { - autocmd Filetype extradite,help,tagbar,qf,vimfiler noremap - autocmd Filetype extradite,help,tagbar,qf,vimfiler noremap - autocmd Filetype extradite,help,tagbar,qf,vimfiler noremap ] - autocmd Filetype extradite,help,tagbar,qf,vimfiler noremap - autocmd Filetype extradite,help,tagbar,qf noremap - autocmd Filetype extradite,help,tagbar,qf noremap - autocmd Filetype extradite,help,tagbar,qf noremap - autocmd Filetype extradite,help,tagbar,qf noremap [ + autocmd Filetype help,qf,vimfiler noremap + autocmd Filetype help,qf,vimfiler noremap + autocmd Filetype help,qf,vimfiler noremap + autocmd Filetype help,qf,vimfiler noremap { + autocmd Filetype help,tagbar,qf,vimfiler noremap + autocmd Filetype help,tagbar,qf,vimfiler noremap + autocmd Filetype help,tagbar,qf,vimfiler noremap ] + autocmd Filetype help,tagbar,qf,vimfiler 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 [ "disable modifier keys with directions that would interfere with logic autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap - autocmd Filetype qf,vimfiler,extradite noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf,vimfiler noremap "}}} diff --git a/vim/config/plugins/lightline.vim b/vim/config/plugins/lightline.vim index 5e3fdab..39ced69 100644 --- a/vim/config/plugins/lightline.vim +++ b/vim/config/plugins/lightline.vim @@ -17,7 +17,6 @@ function! LLFilename() \ &ft == 'vimfiler' ? vimfiler#get_status_string() : \ &ft == 'unite' ? unite#get_status_string() : \ &ft == 'qf' ? '[Error/Location List]' : - \ &ft == 'extradite' ? '[Commit History]' : \ ('' != LLReadonly() ? LLReadonly() . ' ' : '') . \ ('' != fname ? fname : '[NEW]') . \ ('' != LLModified() ? ' ' . LLModified() : '')