diff --git a/configs/.vimrc b/configs/.vimrc index 1b5a30771..3cabc22cf 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -60,6 +60,9 @@ Plugin 'vim-airline/vim-airline-themes' " Visually align assignments Plugin 'godlygeek/tabular' +" Visually Highlight and comment code. +Plugin 'tpope/vim-commentary' + call vundle#end() " required filetype plugin indent on " required @@ -139,7 +142,9 @@ set mouse=a " Highlights matches during a search. set hlsearch -nnoremap / :set hlsearch! +" Search for gibberish to clear the most recent search +" nnoremap / :set hlsearch! +noremap / /__wc_gibberish__ " Use custom-made snippets. @@ -191,8 +196,22 @@ nnoremap l l nnoremap q :bdelete -" Fuzzy-find open buffer via CtrlP -nnoremap bg :CtrlPBuffer +" CtrlP config +" Set default CtrlP command. +let g:ctrlp_cmd = 'CtrlP' +" let g:ctrlp_cmd = 'CtrlPMRU' + +" Set runtime path +set runtimepath^=~/.vim/bundle/ctrlp.vim + +" Fuzzy-find files. +nnoremap pf :CtrlP + +" Fuzzy-find open buffers. +nnoremap pb :CtrlPBuffer + +" Fuzzy-find open buffers. +nnoremap pm :CtrlPMRUFiles " Buffer creation and management @@ -320,6 +339,11 @@ set t_Co=255 highlight Comment cterm=italic +" Repeat last colon-command +nnoremap ;; @: +vnoremap ;; @: + + " Define highlighting groups " NOTE: The ANSII aliases for colors will change when iTerm2 settings are " changed. @@ -329,6 +353,7 @@ highlight InterestingWord2 ctermbg=Blue ctermfg=Black " h1 highlighting nnoremap 1 :execute '2match InterestingWord1 /\<\>/' nnoremap x1 :execute '2match none' +vnoremap 1 :execute '2match InterestingWord1 /\<\>/' " h2 highlighting nnoremap 2 :execute '3match InterestingWord2 /\<\>/' @@ -385,6 +410,8 @@ nnoremap v5 :resize 25 nnoremap v6 :resize 30 nnoremap v7 :resize 35 nnoremap v8 :resize 40 +nnoremap v9 :resize 45 +nnoremap v0 :resize 50 " NERDTree settings @@ -411,7 +438,7 @@ vnoremap L $ " Search for visually selected text -vnoremap // y/" +vnoremap // y/"N " trim trailing whitespace on save @@ -422,18 +449,6 @@ autocmd BufWritePre *.{js,py,tpl,less,html,ex} :%s/\s\+$//e set guifont=Operator\ Mono:h16 -" CtrlP Config. -set runtimepath^=~/.vim/bundle/ctrlp.vim -" let g:ctrlp_map = '' -let g:ctrlp_cmd = 'CtrlP' - -" Maps CtrlP to leader to future-proof config. -nnoremap p :CtrlP - -" Fuzzy-finds files within cwd. -" nnoremap pf :CtrlP - - " Use .gitignore file to populate Ctrl-P let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f']