From 2f82c4fc845a0f65b59593a8bf00d9552455e467 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 27 Feb 2015 05:46:46 -0500 Subject: [PATCH] Change sidebars to F9-F12 and use the same mappings for Ctrl/Alt+F-Keys --- README.md | 19 ++--- vim/config/keyboard.vim | 160 ++++++++++++++++++++++++++-------------- 2 files changed, 111 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 9d19d1a..bcc2d73 100644 --- a/README.md +++ b/README.md @@ -100,13 +100,12 @@ As usual, to have your system use `vimpager` in place of `less`, you'll need to #### Sidebars #### -| Binding | Mode | Action | -|--------------------------------|------|-----------------------------------------------| -| Ctrl or Alt+F1 or Backslash+\[ | ALL | Toggle **vimfiler** file manager sidebar | -| Ctrl or Alt+F2 or Backslash+\] | ALL | Toggle the **gundo** undo history sidebar | -| Ctrl or Alt+F3 or Backslash+{ | ALL | Toggle the **tagbar** source code tag sidebar | -| Ctrl or Alt+F4 or Backslash+} | ALL | Toggle the **extradite** git history window | -| Ctrl or Alt+F12 | ALL | Toggle the **goyo** distraction-free mode | +| Binding | Mode | Action | +|--------------------------------|------|-------------------------------------| +| F9 and Backslash+\[ | ALL | Toggle **vimfiler** file manager sidebar | +| F10 and Backslash+\] | ALL | Toggle the **tagbar** source code tag sidebar | +| F11 and Backslash+} | ALL | Toggle the **extradite** git history window | +| F12 and Backslash+{ | ALL | Toggle the **gundo** undo history sidebar | #### Toggles #### @@ -120,15 +119,13 @@ As usual, to have your system use `vimpager` in place of `less`, you'll need to | F4 | ALL | Toggle external-paste mode | | | | | | \` | N | Toggle gutter (left bar with line numbers etc.) | -| Backslash+F1 | N | Toggle the **vim** reference manual | -| Backslash+Space | N | Toggle the **goyo** distraction-free UI | -| ?+Space | N | Toggle the **spellcheck** bottom bar of mistakes | +| Backslash+\` | N | Toggle the **goyo** distraction-free UI | +| Backslash+? | N | Toggle the **vim** reference manual | #### Spell Check #### | Binding | Mode | Action | |---------|------|-----------------------------------------------| -| ?+Space | N | Toggle spellcheck error list | | ?+ | N | Add the selected word to the local dictionary | | ?? | N | Show spelling suggestions for selected word | | ?N | N | Go to the next spelling mistake | diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 9a96dce..845020e 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -113,26 +113,37 @@ " _ | (N) -> unopen all folds " 0 | (N) -> reset all folds using default fold level " -" | (A) -> toggle vimfiler sidebar -" | (A) -> toggle vimfiler sidebar -" [ | (A) -> toggle vimfiler sidebar -" | (A) -> toggle the tagbar sidebar -" | (A) -> toggle the tagbar sidebar -" ] | (A) -> toggle the tagbar sidebar -" | (A) -> toggle the gundo sidebar -" | (A) -> toggle the gundo sidebar -" { | (A) -> toggle the gundo sidebar -" | (A) -> toggle extradite git commit history -" | (A) -> toggle extradite git commit history -" } | (A) -> toggle extradite git commit history +" | (A) -> toggle vimfiler sidebar +" | (A) -> toggle vimfiler sidebar +" | (A) -> toggle vimfiler sidebar +" [ | (N) -> toggle vimfiler sidebar +" | (A) -> toggle the tagbar sidebar +" | (A) -> toggle the tagbar sidebar +" | (A) -> toggle the tagbar sidebar +" ] | (N) -> toggle the tagbar sidebar +" | (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 gundo sidebar +" | (A) -> toggle the gundo sidebar +" | (A) -> toggle the gundo sidebar +" { | (N) -> toggle the gundo 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 goyo (distraction-free mode) -" | (A) -> toggle goyo (distraction-free mode) +" ` | (A) -> toggle goyo (distraction-free mode) " " (gvim toggles) " | (A) -> toggle the menubar @@ -277,7 +288,7 @@ " " (help) " q | (A) -> close the dialog -" | (A) -> close the dialog +" ? | (A) -> close the dialog " ?> | (A) -> close the dialog " ?< | (A) -> close the dialog " @@ -320,7 +331,7 @@ noremap < "-unmapping help from F1 and Ctrl-F1 for use toggling the reference manual - "+the :h topic feature works, and displays quickref + "+the :h topic feature works, and ? displays quickref map map map @@ -350,8 +361,10 @@ "read/write file with sudo cabbrev sudow SudoWrite cabbrev wsudo SudoWrite + cabbrev ws SudoWrite cabbrev sudoe SudoRead cabbrev esudo SudoRead + cabbrev es SudoRead "add/remove character as keyword cabbrev ik setlocal iskeyword+= @@ -501,7 +514,6 @@ noremap , ':TTagechoWord' "toggle the vim reference manual - nnoremap ':h index.txt' nnoremap ? ':h index.txt' "toggle the display of the left gutter @@ -522,50 +534,74 @@ nnoremap 0 'zX:echo "all folds have been reset"' "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' + 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' "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"' + xnoremap ':TagbarTogglegv' + inoremap ':TagbarToggle' + nnoremap ':TagbarToggle:echo "tagbar toggled"' + xnoremap ':TagbarTogglegv' + inoremap ':TagbarToggle' nnoremap ] ':TagbarToggle:echo "tagbar toggled"' - "bindings to trigger the gundo undo history - nnoremap ':GundoToggle:echo "undo history sidebar toggled"' - xnoremap ':GundoToggle' - inoremap ':GundoToggle' - nnoremap ':GundoToggle:echo "undo history sidebar toggled"' - xnoremap ':GundoToggle' - inoremap ':GundoToggle' - nnoremap { ':GundoToggle:echo "undo history sidebar toggled"' - "view commit history and diffs - nnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - xnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - inoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - nnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - xnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' - inoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + nnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + xnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + inoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + nnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + xnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + inoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + nnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + xnoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + inoremap ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' nnoremap } ':SyntasticToggleOff:Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + "bindings to trigger the gundo undo history + nnoremap ':GundoToggle:echo "undo history sidebar toggled"' + xnoremap ':GundoToggle' + inoremap ':GundoToggle' + nnoremap ':GundoToggle:echo "undo history sidebar toggled"' + xnoremap ':GundoToggle' + inoremap ':GundoToggle' + nnoremap ':GundoToggle:echo "undo history sidebar toggled"' + xnoremap ':GundoToggle' + inoremap ':GundoToggle' + nnoremap { ':GundoToggle:echo "undo history sidebar toggled"' + "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!:echo "spell checking toggled"' xnoremap ':set spell!gv' inoremap ':set spell!' + nnoremap ':set spell!:echo "spell checking toggled"' + xnoremap ':set spell!gv' + inoremap ':set spell!' + nnoremap ':set spell!:echo "spell checking toggled"' + xnoremap ':set spell!gv' + inoremap ':set spell!' "toggle external-paste mode set pastetoggle= @@ -574,10 +610,15 @@ nnoremap ':SyntasticToggleAll' xnoremap ':SyntasticToggleAllgv' inoremap ':SyntasticToggleAll' + nnoremap ':SyntasticToggleAll' + xnoremap ':SyntasticToggleAllgv' + inoremap ':SyntasticToggleAll' + nnoremap ':SyntasticToggleAll' + xnoremap ':SyntasticToggleAllgv' + inoremap ':SyntasticToggleAll' "toggle goyo - nnoremap ':Goyo' - nnoremap ':Goyo' + nnoremap ` ':Goyo' "} "GVIM TOGGLES:{ @@ -784,8 +825,9 @@ 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 + autocmd FileType extradite map q "gundo autocmd FileType gundo map 0l @@ -822,8 +864,6 @@ autocmd FileType qf map h j autocmd FileType qf map l k autocmd FileType qf map q ':call ToggleQuickfixList()' - autocmd FileType qf map ':call ToggleQuickfixList()' - autocmd FileType qf map ':call ToggleQuickfixList()' "vimdiff autocmd FilterWritePre * if &diff|nmap <> ':diffu'|endif @@ -848,13 +888,19 @@ "MAPPINGS DISABLED FOR GIVEN FILETYPES: {{{ "remove incompatible toggles from specific file types - autocmd Filetype qf,gundo,vimfiler,tagbar,extradite,help noremap ` - autocmd Filetype qf,vimfiler,extradite,help noremap - autocmd Filetype qf,vimfiler,extradite,help noremap - autocmd Filetype gundo,vimfiler,extradite,help noremap - autocmd Filetype gundo,vimfiler,extradite,help noremap - autocmd Filetype qf,gundo,vimfiler,tagbar,help,diff noremap - autocmd Filetype qf,gundo,vimfiler,tagbar,help,diff noremap + autocmd Filetype extradite,gundo,help,tagbar,qf,vimfiler noremap ` + autocmd Filetype extradite,gundo,help,tagbar,qf noremap + autocmd Filetype extradite,gundo,help,tagbar,qf noremap + autocmd Filetype extradite,gundo,help,tagbar,qf noremap + autocmd Filetype extradite,gundo,help,qf,vimfiler noremap + autocmd Filetype extradite,gundo,help,qf,vimfiler noremap + autocmd Filetype extradite,gundo,help,qf,vimfiler noremap + autocmd Filetype gundo,help,tagbar,qf,vimfiler,diff noremap + autocmd Filetype gundo,help,tagbar,qf,vimfiler,diff noremap + autocmd Filetype gundo,help,tagbar,qf,vimfiler,diff 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 "disable modifier keys with directions that would interfere with logic autocmd Filetype qf,gundo,vimfiler noremap