"============================================================" " " " Darkcloud Vim Config: keyboard settings " " " " Maintainer: Kevin MacMartin (prurigro@gmail.com) " " Website: https://github.com/prurigro/darkcloud-vimconfig " " " " License: MIT " " " "============================================================" " " Note: " *The default key is: \ " " Aliases: " :GitLog & :gitlog | (C) -> show a navigatable log of commit history " :GitDiff & :gitdiff | (C) -> current file and last commit in vimdiff " :GitStatus & :gitstatus | (C) -> shows the output of git status " :GitCommit & :gitcommit | (C) -> commits changes to the current file " :wsudo & :sudow | (C) -> write the file as root using sudo " :esudo & :sudoe | (C) -> read a file as root using sudo " " Reference: (view plugin documentation for the full list of commands each offers) " (tcomment _ can also be -) " | (A) -> comment selection/create an empty comment " gc | (A) -> comment selection/create an empty comment " b | (A) -> comment the current block(s) " r | (A) -> comment everything on the line to the right " p | (A) -> comment the current paragraph " + | (V) -> increase the selected region " _ | (V) -> decrease the selected region " | (N) -> center content and hide everything else " " (surround) " S" | (V) -> surround selection with quotes " S | (V) -> surround selection " ds" | (N) -> delete surrounding "" " dst | (N) -> delete surrounding tag (ie: ) " cs'" | (N) -> change surrounding '' to "" (any delimiters work) " cs" | (N) -> change surrounding "" to the tag: " cst" | (N) -> change any surrounding tag to "" " " Mappings: " (mouse) " | (A) -> unbind this from vim so xorg can paste " " | (A) -> scroll right a few characters at a time " | (A) -> scroll left a few characters at a time " | (A) -> scroll right one character at a time " | (A) -> scroll left one character at a time " " | (A) -> behaves like right-click (selects to the cursor) " " | (A) -> copy selection or character under the cursor " | (A) -> copy selection or character under the cursor " | (A) -> cut selection or character under the cursor " | (A) -> cut selection or character under the cursor " | (A) -> paste at the cursor (not mouse) " | (A) -> paste at the cursor (not mouse) " " | (A) -> select the word being clicked " | (A) -> select the line being clicked " | (A) -> select the paragraph being clicked " " (tabs) " | (N) -> go to the next open tab " | (N) -> go to the previous open tab " | (N) -> open a new tab " | (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 " " (gvim toggles) " | (A) -> toggle the menu " | (A) -> toggle the toolbar " | (A) -> toggle the scrollbar " " (completion) " , | (A) -> enter after emmet 'word' (ie: html:5) " \\ | (N) -> show spelling suggestions popup for word " \| | (N) -> add word to a local list of correct spellings " | (I) -> (neocomp) autocomplete using common string " | (I) -> (neocomp) autocomplete the common string " | (I) -> (neocomp) close the suggestion popup " | (I) -> (neocomp) undo the most recent completion " " (formatting) " | (V) -> deletes currently selected text " | (N) -> format document and return to cursor " | (V) -> format the selection and return to cursor " | (N) -> format document using :Autoformat " | (N) -> format document to a width of 79 characters " | (V) -> format selection to a width of 79 characters " | (N) -> remove whitespace " | (N) -> convert tabs into spaces " \ | (N) -> remove search highlighting " | (N) -> an alt mapping to remove search highlighting " | (V) -> indent all the lines currently selected " | (N) -> indent the current line " | (V) -> unindent all the lines currently selected " | (N) -> unindent the current line " " (movement) " = | (N) -> move to the first character on the next line " | (N) -> move to the beginning of the document " | (N) -> move to the end of the document " | (N) -> move to the end of the line " | (N) -> move to the beginning of the non-whitespace " " | (N) -> move a few lines up " | (N) -> move a few lines down " " | (V) -> move a block up one line " | (V) -> move a block down one line " | (N) -> move a line up one line " | (N) -> move a line down one line " " | (V) -> move a block up a half page " | (V) -> move a block down a half page " | (N) -> move a line up a half page " | (N) -> move a line down a half page " | (V) -> move a block up a half page " | (V) -> move a block down a half page " | (N) -> move a line up a half page " | (N) -> move a line down a half page " " >> | (N) -> next difference (vimdiff/signify) " << | (N) -> previous difference (vimdiff/signify) " " (selection) " | (N) -> select all text " a | (N) -> select all text " | (V) -> select all text " a | (V) -> select all text " " | (V) -> select all text above " | (V) -> select all text below " | (V) -> select all text to the right " | (V) -> select all text to the left up to the indent " " | (V) -> select a few lines up " | (V) -> select a few lines down " | (V) -> select a few lines right " | (V) -> select a few lines left " " (copy/paste and undo/redo) " 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 " p | (V) -> preserve the buffer pasting over selected text " Direction | (N) -> paste in the direction entered " " (delete/cut functions) " 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 " X | (V) -> delete the currently selected lines " D | (N) -> delete chars under and after the cursor on the line " D | (V) -> delete the currently selected lines " dw | (N) -> delete chars under and after the cursor in the word " dd | (N) -> delete lines under and after the one below " d | (V) -> delete the currently selected text " " (typical 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 " " (remap dangerous functions that skip undo) " | (I) -> undo-able equivalent " | (I) -> undo-able equivalent " " Filetype Specific Mappings: " (breeze->html compat) " _ | (N) -> move to the next sibling tag " + | (N) -> move to the previous sibling tag " - | (N) -> move to the first sibling tag " = | (N) -> move to the last sibling tag " _ | (N) -> move to the first child tag " + | (N) -> move to the last child tag " | (N) -> move to the parent tag " " (extradite) " | (A) -> close the dialog " | (A) -> same as down " l | (A) -> same as j " | (A) -> same as Up " h | (A) -> same as k " " (gundo) " | (A) -> same as normal + justify on the left " | (A) -> same as the left mouse " | (A) -> same as the left mouse " | (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 " " (markdown) " | (A) -> show heading TOC instead of the taglist " " (markdown toc) " | (A) -> left click + left justify the cursor " | (A) -> same as the left click " | (A) -> same as the left click " | (A) -> select heading to edit " | (A) -> select heading but remain in toc " | (A) -> up " | (A) -> down " h | (A) -> j " l | (A) -> k " " (vimdiff) " <> | (N) -> update differences " >< | (N) -> update differences " > | (N) -> replace diff in other pane with current pane " replace diff in current pane with other pane " " (vimfiler) " | (A) -> left click + left justify the cursor " | (A) -> same as the left click " | (A) -> same as the left click " | (A) -> edit selected file " | (A) -> map to l, which opens a directory " | (A) -> map to h, which goes up one directory " ' | (A) -> edit the selected file " n | (A) -> start editing a new file " "DISABLED DEFAULT MAPPING: UNSET SHORTCUTS {{{ noremap > noremap < "}}} "ALIASES: COMMAND SHORTCUTS {{{ 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' cabbrev gitstatus ':Gstatus' cabbrev GitCommit ':Gcommit' cabbrev gitcommit ':Gcommit' cabbrev sudow SudoWrite cabbrev wsudo SudoWrite cabbrev sudoe SudoRead cabbrev esudo SudoRead "}}} "MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{ "MOUSE:{ "configure middle click to paste from X noremap noremap! "hold ctrl to scroll left/right instead of up/down noremap 4zl noremap 4zh inoremap 4zl inoremap 4zh "hold alt to scroll left/right more precisely noremap zl noremap zh inoremap zl inoremap zh "middle click behaves like right and selects from cursor noremap "ctrl+middle/right = copy line in normal and selection in visual nnoremap Vy nnoremap Vy vnoremap y vnoremap y inoremap p inoremap p "ctrl+alt+middle/right = paste nnoremap x nnoremap x xnoremap x xnoremap x inoremap x inoremap x "ctrl+alt+middle/right = paste nnoremap p nnoremap p xnoremap p xnoremap p inoremap p inoremap p "ctrl+left = word nnoremap bvw xnoremap bvw inoremap bvw "alt+left = line nnoremap V xnoremap V inoremap V "ctrl-alt+left = paragraph nnoremap vip xnoremap vip inoremap vip "} "TABS:{ nnoremap ':tabnext' nnoremap ':tabprev' nnoremap ':tabnew' nnoremap ':VimFiler -tab -project' 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' nnoremap ?? ':h quickref' nnoremap ?> ':exusage' nnoremap ?< ':viusage' "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!' "toggle the cursor line and column nnoremap ':set cursorline! cursorcolumn!:echo "cursor crosshair toggled"' xnoremap ':set cursorline! cursorcolumn!gv' inoremap ':set cursorline! cursorcolumn!' "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