diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 098c585..6eaf819 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -11,6 +11,7 @@ " ds" | (N) -> delete surrounding "" " " Mappings: +" | (A) -> unbind this from vim so xorg can paste " | (A) -> go to the next open tab "

| (A) -> go to the previous open tab " | (V) -> indent a block in visual mode @@ -22,14 +23,21 @@ " | (N) -> toggle line wrapping " | (A) -> toggle visible trailing whitespace " | (A) -> toggle collapsed/folded rows +" | (V) -> paste and replace the selection +" | (N) -> paste and replace the current word " | (N) -> format document and return to current line " | (N) -> remove whitespace -" | (N) -> paste and replace the current word -" | (V) -> paste and replace the selection -" | (A) -> move up a chunk of text -" | (A) -> move down a chunk of text -" | (N) -> move to the start of the text -" | (N) -> move to the end of the 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 to the beginning of the line +" | (N) -> select all +" | (N) -> select all text above the cursor +" | (N) -> select all text below the cursor +" | (N) -> select all text to the right of the cursor +" | (N) -> select to the beginning of the non-whitespace +" | (N) -> select to the beginning of the line " " (neocomplcache) " | (I) -> write the part common to all suggestions @@ -50,29 +58,33 @@ " "MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{ + "map shift to enable middle-click paste while being held + noremap + noremap! + "tab and untabbing selected blocks - vmap >gv - vmap >gv + vnoremap n ':tabn' - nnoremap p ':tabp' + nnoremap n ':tabn' + nnoremap p ':tabp' "toggle the cursor line and column - nnoremap ':set cursorline! cursorcolumn!' + nnoremap ':set cursorline! cursorcolumn!' "toggle the display of line numbers - nnoremap ':set number!' + nnoremap ':set number!' "toggle line wrapping (and bottom bar if using the gui) if !has("gui_running") - nnoremap ':set wrap!' + nnoremap ':set wrap!' else - nnoremap ':set wrap! go'.'-+'[&wrap]."=b\r" + nnoremap ':set wrap! go'.'-+'[&wrap]."=b\r" endif "toggle the display of whitespace - nnoremap ':set list!' + nnoremap ':set list!' "toggle folded code at foldpoints inoremap za @@ -80,40 +92,43 @@ onoremap za vnoremap zf + "map shift-p to paste and replace the current word or selection + vnoremap "_d"0P + nnoremap "_diwP + "format document then return to current line nnoremap mzgg=G`z "remove trailing white space - nnoremap ':FixWhitespace' + nnoremap ':FixWhitespace' - "map shift to enable middle-click paste while being held - map - map! + "remap keys to scroll through text + nnoremap gg0 + nnoremap G$ + nnoremap $ + nnoremap ^ + nnoremap 0 - "map shift-p to paste and replace the current word or selection - nnoremap "_diwP - vnoremap "_d"0P - - "map ctrl-up/down to moving up/down by a block of text - map - map - - "map shift-left/right to move to the start/end of the line's text - nmap ^ - nmap $ + "map remap keys to select text + nnoremap ggvG + nnoremap vgg0 + nnoremap vG$ + nnoremap v$ + nnoremap v^ + nnoremap v0 "}}} "PLUGIN KEYBINDINGS {{{ "toggle the nerd tree sidebar - nnoremap ':NERDTree' + nnoremap ':NERDTree' "toggle the tagbar sidebar - nnoremap ':TagbarToggle' + nnoremap ':TagbarToggle' "neocomplcache suggestions: cancel, autocomplete, scroll up and scroll down - inoremap pumvisible() ? neocomplcache#complete_common_string() : "\" - inoremap pumvisible() ? neocomplcache#close_popup() : "\" - inoremap neocomplcache#undo_completion() + inoremap pumvisible() ? neocomplcache#complete_common_string() : "\" + inoremap pumvisible() ? neocomplcache#close_popup() : "\" + inoremap neocomplcache#undo_completion() "emmet switch triggerkey from to let g:user_emmet_leader_key='' @@ -130,9 +145,9 @@ "GVIM: MAPPINGS FOR GUI ELEMENTS {{{ "map toggles for the menu, toolbar and scrollbar - noremap ":if &go=~#'m'set go-=melseset go+=mendif" - noremap ":if &go=~#'T'set go-=Telseset go+=Tendif" - noremap ":if &go=~#'r'set go-=relseset go+=rendif" + noremap ":if &go=~#'m'set go-=melseset go+=mendif" + noremap ":if &go=~#'T'set go-=Telseset go+=Tendif" + noremap ":if &go=~#'r'set go-=relseset go+=rendif" "}}} "ALIASES: COMMAND SHORTCUTS {{{ diff --git a/vim/config/settings.vim b/vim/config/settings.vim index eba6246..cbcc450 100644 --- a/vim/config/settings.vim +++ b/vim/config/settings.vim @@ -19,10 +19,13 @@ filetype plugin indent on syntax on "turn syntax highlighting on set foldmethod=syntax foldcolumn=1 foldlevel=8 "configure how folding code works + set formatoptions=roqnl12 "configure format options "}}} "FILETYPES: SETTINGS SPECIFIC TO A FILETYPE {{{ - au BufNewFile,BufRead *.txt set spell "enable spellcheck for text files (*.txt) + au FileType mail setl spell "enable spellcheck for e-mail (mutt) + au FileType gitcommit setl spell "enable spellcheck in git commits + au BufNewFile,BufRead *.txt setl spell "enable spellcheck for text files (*.txt) au BufNewFile,BufRead *tmux.conf setf sh "set syntax for *tmux.conf to sh (bash) au BufNewFile,BufRead pacman.conf setf sh "set syntax for *tmux.conf to sh (bash) au BufNewFile,BufRead yaourtrc setf sh "set syntax for *tmux.conf to sh (bash)