"==========================" " Keyboard Configuration: " "===========================" " " Note: " *The default key is: \ " " Reference: (view plugin documentation for the full list of commands each offers) " cs'" | (N) -> change surrounding '' to "" (any delimiters work) " cs" | (N) -> change surrounding "" to the tag: " cst" | (N) -> change any surrounding tag to "" " ds" | (N) -> delete surrounding "" " " Mappings: " (mouse) " | (A) -> scroll right " | (A) -> scroll left " | (A) -> unbind this from vim so xorg can paste " " (tabs) " | (A) -> open a new tab " | (A) -> go to the next open tab " | (A) -> go to the previous open tab " " (toggles) " | (A) -> toggle line numbers " | (A) -> toggle row/column highlighting " | (A) -> toggle spellcheck " | (A) -> toggle line wrapping " | (A) -> toggle the nerdtree sidebar " | (A) -> toggle the tagbar sidebar " | (A) -> toggle collapsed/folded rows " | (A) -> toggle all folds " | (A) -> toggle all folds " " (gvim toggles) " | (A) -> toggle the menu " | (A) -> toggle the toolbar " | (A) -> toggle the scrollbar " " (spelling-and-completion) " , | (A) -> enter this following an emme 'word' (ie: html:5) " \\ | (N) -> show spelling suggestions popup for word " \| | (N) -> add word to a local list of correct spellings " | (N) -> undo the most recent match selection " | (I) -> write the part common to all suggestions " | (I) -> cancle the match dialog (during suggestion) " " (formatting) " | (V) -> deletes currently selected text " | (N) -> deletes the character behind the cursor " | (N) -> format document and return to current line " | (N) -> remove whitespace " | (N) -> convert tabs into spaces " \ | (N) -> 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 beginning of the document " | (N) -> move to the end of the document " | (N) -> move to the end of the document " | (N) -> move to the end of the line " | (N) -> move to the end of the line " | (N) -> move to the beginning of the non-whitespace " | (N) -> move to the beginning of the line " " (selection) " | (V) -> select all " | (N) -> select all " a | (V) -> select all " a | (N) -> select all " | (V) -> toggle selection of all text above the cursor " | (N) -> select all text above the cursor " | (V) -> toggle selection of all text above the cursor " | (N) -> select all text above the cursor " | (V) -> toggle selection of all text below the cursor " | (N) -> select all text below the cursor " | (V) -> toggle selection of all text below the cursor " | (N) -> select all text below the cursor " | (V) -> toggle selection of all text to the right of the cursor " | (N) -> select all text to the right of the cursor " | (V) -> toggle selection of all text to the right of the cursor " | (N) -> select all text to the right of the cursor " | (V) -> toggle selection of all non-whitespace to the left " | (N) -> select all non-whitespace to the left " | (V) -> toggle selection of all non-whitespace to the left " | (N) -> select to the beginning of the line " " (vimdiff) " du | (N) -> update differences " | (N) -> next difference " | (N) -> previous difference " < | (N) -> replace diff in current pane with other pane " > | (N) -> replace diff in other pane with current pane " " (paste-buffer-override) " p | (V) -> paste and replace the currently selected text " P | (V) -> paste and replace the currently selected text " \d | (V) -> delete the currently selected text " \x | (V) -> delete the currently selected text " \x | (N) -> delete the char(s) under and the cursor " \X | (V) -> delete the currently selected lines " \X | (N) -> delete the char(s) before the cursor " \D | (V) -> delete the currently selected lines " \D | (N) -> delete chars under and after the cursor on the line " \dw | (N) -> delete chars under and after the cursor in the word " \dd | (N) -> delete lines under and after the one below " " Aliases: " :wsudo -and- :sudow | (C) -> :SudoWrite (write the file as root using sudo) " :esudo -and- :sudoe | (C) -> :SudoRead (read a file as root using sudo) " "MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{ "MOUSE:{ "hold shift to enable middle-click paste noremap noremap! "hold ctrl to scroll left/right instead of up/down noremap 3zl noremap 3zh "} "TABS:{ "move to the next and previous tabs nnoremap ':tabnew' nnoremap ':tabnext' nnoremap ':tabprev' "} "TOGGLES:{ "unmap F1 from help then map it to toggle the display of line numbers nnoremap ':set number!' vnoremap ':set number!v' inoremap ':set number!' "toggle the cursor line and column nnoremap ':set cursorline! cursorcolumn!' vnoremap ':set cursorline! cursorcolumn!v' inoremap ':set cursorline! cursorcolumn!' "toggle spellcheck nnoremap ':set spell!' vnoremap ':set spell!v' inoremap ':set spell!' "toggle line wrapping (and bottom bar if using the gui) nnoremap ':set wrap! go'.'-+'[&wrap]."=b\r" vnoremap ':set wrap! go'.'-+'[&wrap]."=b\rv" inoremap ':set wrap! go'.'-+'[&wrap]."=b\r" "bindings to trigger the nerdtree and tagbar sidebars nnoremap ':NERDTreeToggle' vnoremap ':NERDTreeToggle' inoremap ':NERDTreeToggle' nnoremap ':TagbarToggle' vnoremap ':TagbarTogglev' inoremap ':TagbarToggle' "toggle folded code at foldpoints nnoremap za vnoremap zav inoremap za "toggle all folds nnoremap zi vnoremap ziv inoremap zi "} "GVIM TOGGLES:{ "map toggles for the menu, toolbar and vertical scrollbar nnoremap ":if &go=~#'m'set go-=melseset go+=mendif" vnoremap ":if &go=~#'m'set go-=melseset go+=mendifv" inoremap ":if &go=~#'m'set go-=melseset go+=mendif" nnoremap ":if &go=~#'T'set go-=Telseset go+=Tendif" vnoremap ":if &go=~#'T'set go-=Telseset go+=Tendifv" inoremap ":if &go=~#'T'set go-=Telseset go+=Tendif" nnoremap ":if &go=~#'r'set go-=relseset go+=rendif" vnoremap ":if &go=~#'r'set go-=relseset go+=rendifv" inoremap ":if &go=~#'r'set go-=relseset go+=rendif" "} "SPELLING AND COMPLETION:{ "emmet switch triggerkey from to let g:user_emmet_leader_key='' "press backslash twice on a mispelled word for suggestions nnoremap \\ ea nnoremap \| zg "neocomplcache suggestions: cancel, autocomplete, scroll up and scroll down inoremap neocomplcache#undo_completion() inoremap pumvisible() ? neocomplcache#complete_common_string() : "\" inoremap pumvisible() ? neocomplcache#close_popup() : "\" "} "FORMATTING:{ "have backspace delete the selected text vnoremap x nnoremap il "formatting options to apply to the whole document nnoremap mzgg=G`z nnoremap ':FixWhitespace' nnoremap ':retab:noh' nnoremap / ':noh' "tab and untab the currently selected lines vnoremap >gv nnoremap v>gv vnoremap v "} "MOVEMENT:{ "additional mappings for easier access nnoremap = + "remap keys to scroll through text nnoremap gg0 nnoremap gg0 nnoremap G$ nnoremap G$ nnoremap $ nnoremap $ nnoremap ^ nnoremap ^ "} "SELECTION:{ "map remap keys to select text vnoremap gg0vG$ nnoremap gg0vG$ vnoremap a gg0vG$ nnoremap a gg0vG$ vnoremap gg0 nnoremap vgg0 vnoremap gg0 nnoremap vgg0 vnoremap G$ nnoremap vG$ vnoremap G$ nnoremap vG$ vnoremap $ nnoremap v$ vnoremap $ nnoremap v$ vnoremap ^ nnoremap v^ vnoremap ^ nnoremap v^ "} "VIMDIFF:{ "map shortcuts for vimdiff nnoremap du ':diffu' nnoremap ]c nnoremap [c nnoremap < do nnoremap > dp "} "PASTE BUFFER OVERRIDE:{ "alternatives that preserve the paste buffer vnoremap p "_d"0P vnoremap P "_d"0P vnoremap x "_x nnoremap x "_x vnoremap X "_X nnoremap X "_X vnoremap D "_D nnoremap D "_D vnoremap d "_d nnoremap dd "_dd nnoremap dw "_dw "} "}}} "ALIASES: COMMAND SHORTCUTS {{{ cabbrev sudow SudoWrite cabbrev wsudo SudoWrite cabbrev sudoe SudoRead cabbrev esudo SudoRead "}}} "TMUX AND SCREEN COMPATIBILITY: SOME HACKS TO MAKE THINGS WORK RIGHT {{{ "general compatibility settings for both screen and tmux if $TERM =~ '^screen-256color' nmap OH imap OH nmap OF imap OF endif "full keyboard compatibility for tmux with xterm-keys enabled if &term =~ '^screen' && exists('$TMUX') execute "set =\e[1;*A" execute "set =\e[1;*B" execute "set =\e[1;*C" execute "set =\e[1;*D" execute "set =\e[1;*H" execute "set =\e[1;*F" execute "set =\e[2;*~" execute "set =\e[3;*~" execute "set =\e[5;*~" execute "set =\e[6;*~" execute "set =\e[1;*P" execute "set =\e[1;*Q" execute "set =\e[1;*R" execute "set =\e[1;*S" execute "set =\e[15;*~" execute "set =\e[17;*~" execute "set =\e[18;*~" execute "set =\e[19;*~" execute "set =\e[20;*~" execute "set =\e[21;*~" execute "set =\e[23;*~" execute "set =\e[24;*~" endif "}}}