From 64f2b299325cff5b30996cb647de434bfbf14402 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 13 Jun 2014 00:58:13 -0400 Subject: [PATCH] Reorganized and improved and added to the mappings, and updated the README with a few more. --- README.md | 31 ++++-- vim/config/keyboard.vim | 208 ++++++++++++++++++++-------------------- 2 files changed, 130 insertions(+), 109 deletions(-) diff --git a/README.md b/README.md index 7708382..8f6d8e2 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,30 @@ ### Keyboard ### -**Todo**: For now, check comments at the top of *[vim/config/keyboard.vim](https://github.com/prurigro/darkcloud-vimconfig/blob/master/vim/config/keyboard.vim)* for a list. +#### Toggles and Sidebars #### + +| Binding | Mode | Action | +|:----------------------|:----:|-------------------------------------------------:| +| | NORM | Toggle the **goyo** distraction-free UI | +| | | | +| ?? | NORM | Toggle the Vim reference manual | +| ~ | NORM | Toggle **vimfiler** file manager sidebar | +| ` | NORM | Toggle the gutter (line #s, folds, git diffs) | +| | | | +| | ALL | Toggle the **gundo** undo history sidebar | +| | ALL | Toggle the spellcheck list of incorrect words | +| | ALL | Toggle the **tagbar** source code tag sidebar | +| | ALL | Toggle the Extradite git history window | +| | | | +| | ALL | Toggle line wrapping | +| | ALL | Toggle spell check word highlighting | +| | ALL | Toggle source code syntax checking | +| | | | +| | ALL | Toggle the menubar **(gvim)** | +| | ALL | Toggle the toolbar **(gvim)** | +| | ALL | Toggle the scrollbars **(gvim)** | + +**Complete Reference**: For a complete list of darkcloud-vimconfig specific mappings, check the list in the comments at the top of [vim/config/keyboard.vim](https://github.com/prurigro/darkcloud-vimconfig/blob/master/vim/config/keyboard.vim). ## Plugins ## @@ -116,12 +139,6 @@ * [vim-togglelist](https://github.com/milkypostman/vim-togglelist.git) Supplies toggle functions for the *location* and *error* lists, which are used by a number of plugins and normally require separate open and close commands. * [vim-trailing-whitespace](https://github.com/bronson/vim-trailing-whitespace.git) Highlights and allows for the easy removal of trailing whitespace in documents. -## Notes ## - -* **Runtimepath**: To find the runtimepath locations currently set, run the following in vim: `:verbose set runtimepath`. -* **Key Bindings**: You can find a list of the bindings added by darkcloud-vimconfig, as well as a few of the ones added by plugins in _vim/config/keyboard.vim_. -* **Vim Quick Reference**: Type _??_, _?>_ and _?<_ to toggle sidebars with three styles of quick reference material on different reference topics. - ## Credits ## * Written by Kevin MacMartin: [GitHub Projects](https://github.com/prurigro?tab=repositories) | [Arch Linux AUR Packages](https://aur.archlinux.org/packages/?SeB=m&K=prurigro) diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index ab2ee2a..19c38c6 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -39,6 +39,8 @@ " cs'" | (N) -> change surrounding '' to "" (any delimiters work) " cs" | (N) -> change surrounding "" to the tag: " cst" | (N) -> change any surrounding tag to "" +" ysiw' | (N) -> surround the current word with '' +" yss' | (N) -> surround non-whitespace of current line with '' " " Mappings: " (mouse) @@ -70,30 +72,29 @@ " | (N) -> create a new tab with vimfiler " | (N) -> create a new tab with a double pane vimfiler " -" (toggles) -" ?? | (N) -> toggle the quick reference sidebar -" ?> | (N) -> toggle command reference sidebar -" ?< | (N) -> toggle normal mode key bindings reference sidebar -" `` | (N) -> toggle the vimfiler sidebar on the right -" ~~ | (N) -> toggle the vimfiler sidebar on the left -" | (N) -> toggle folds -" | (A) -> toggle line numbers -" | (A) -> toggle row/column cursor highlighting -" | (A) -> toggle line wrapping -" | (A) -> toggle all folds -" | (A) -> toggle spell check -" | (A) -> toggle syntax checking -" | (A) -> toggle version control differences -" | (A) -> toggle version control commit history -" | (A) -> toggle the tagbar sidebar -" | (A) -> toggle the location list to check syntax errors -" | (A) -> toggle the gundo undo history sidebar -" | (A) -> enable spellcheck & toggle list of spelling errors +" (toggles and features) +" ?? | (N) -> toggle the vim reference manual +" ~ | (N) -> toggle vimfiler sidebar +" ` | (A) -> toggle the gutter(line numbers, folds and signify) +" +" Space | (N) -> toggle selected fold +" + | (N) -> open all folds +" - | (N) -> unopen all folds +" 0 | (N) -> reset all folds using default fold level +" +" | (N) -> toggle the gundo sidebar +" | (A) -> toggle spellcheck error list +" | (A) -> toggle the tagbar sidebar +" <12> | (A) -> toggle extradite git commit history +" +" | (A) -> toggle line wrapping +" | (A) -> toggle spell check +" | (A) -> toggle syntax checking " " (gvim toggles) -" | (A) -> toggle the menu -" | (A) -> toggle the toolbar -" | (A) -> toggle the scrollbar +" | (A) -> toggle the menubar +" | (A) -> toggle the toolbar +" | (A) -> toggle the scrollbar " " (completion) " , | (A) -> enter after emmet 'word' (ie: html:5) @@ -164,6 +165,7 @@ " | (V) -> select a few lines left " " (copy/paste and undo/redo) +" | (N) -> toggle paste mode " p | (N) -> view the paste buffers and register contents " y | (N) -> copies the character at the cursor " P | (V) -> save selection to the buffer and paste over @@ -258,8 +260,15 @@ " "DISABLED DEFAULT MAPPING: UNSET SHORTCUTS {{{ + "-unmapping tabbing from < and > for use with diff + "+these commands are replaced by tab and shift+tab noremap > noremap < + + "-unmapping help from F1 and Ctrl-F1 for use toggling the reference manual + "+the :h topic feature works, and ?? displays quickref + map + map "}}} "ALIASES: COMMAND SHORTCUTS {{{ @@ -351,86 +360,83 @@ nnoremap ':VimFiler -tab -project -double' "} - "TOGGLES:{ - "bindings to trigger vimfiler - nnoremap `` ':VimFiler -split -simple -toggle -no-quit -direction=botright -winwidth=45' - nnoremap ~~ ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' + "TOGGLES AND FEATURES:{ + "toggle the vim reference manual + nnoremap ?? ':h index.txt' - nnoremap ?? ':h quickref' - nnoremap ?> ':exusage' - nnoremap ?< ':viusage' + "trigger vimfiler + nnoremap ~ ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' + + "toggle the display of the left gutter + nnoremap ` ':if (&number)set number!if (&foldenable)set foldenable!endifif (b:sy.active)SignifyToggleendifelseset number!if !(&foldenable)set foldenable!endifif !(b:sy.active)SignifyToggleendifendif:echo "gutter visibility toggled"' "toggle folded code at foldpoints nnoremap za - "unmap F1 from help then map it to toggle the display of line numbers - nnoremap ':set number!:echo "line numbers toggled"' - xnoremap ':set number!gv' - inoremap ':set number!' + "open all folds + nnoremap + 'zn:echo "all folds have been opened"' + xnoremap + 'zngv' + inoremap + 'zn' - "toggle the cursor line and column - nnoremap ':set cursorline! cursorcolumn!:echo "cursor crosshair toggled"' - xnoremap ':set cursorline! cursorcolumn!gv' - inoremap ':set cursorline! cursorcolumn!' + "close folds set to be closed + nnoremap - 'zN:echo "all opened folds have been closed"' + xnoremap - 'zNgv' + inoremap - 'zN' - "toggle line wrapping (and bottom bar if using the gui) - nnoremap ':echo "line wrapping toggled":set wrap!' - xnoremap ':set wrap!gv' - inoremap ':set wrap!' - - "toggle all folds - nnoremap zi:echo "code folding toggled" - xnoremap zigv - inoremap zi - - "toggle spellcheck - nnoremap ':set spell!:echo "spell checking toggled"' - xnoremap ':set spell!gv' - inoremap ':set spell!' - - "toggle syntax checking - nnoremap ':SyntasticToggleMode' - xnoremap ':SyntasticToggleModegv' - inoremap ':SyntasticToggleMode' - - "toggle signify and signify highlight - let g:signify_mapping_toggle = '' - nnoremap ':Extradite:wincmd x:wincmd j:resize 10' - xnoremap ':Extradite:wincmd x:wincmd j:resize 10v' - inoremap ':Extradite:wincmd x:wincmd j:resize 10' - - "bindings to trigger the tagbar list of tags - nnoremap ':TagbarToggle:echo "tagbar toggled"' - xnoremap ':TagbarTogglegv' - inoremap ':TagbarToggle' - - "bindings to trigger the tagbar list of errors - nmap