From 1870aadddbaee0132e94006cd1bec5b315e1a4fe Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 8 Nov 2016 14:50:17 -0500 Subject: [PATCH] Reassigned leader; removes dead code; adds new mappings --- usbify/vim/.vimrc | 180 +++++++++++++++++++++++++--------------------- 1 file changed, 99 insertions(+), 81 deletions(-) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index c4ebeb098..9ddfe6d41 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -13,12 +13,16 @@ Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. -" plugin on GitHub repo + +" Displays git information in airline. Plugin 'tpope/vim-fugitive' -" All of your Plugins must be added before the following line Plugin 'Raimondi/delimitMate' + +" Autocompletion Plugin 'Valloric/YouCompleteMe' + +" Displays git-tracked C*UD ops within gutter. Plugin 'airblade/vim-gitgutter' Plugin 'kien/ctrlp.vim' Plugin 'mileszs/ack.vim' @@ -26,34 +30,49 @@ Plugin 'pangloss/vim-javascript' Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' +" Themes Plugin 'sickill/vim-monokai' Plugin 'altercation/vim-colors-solarized' +" Executes shell commands and pipes output into new Vim buffer. Plugin 'sjl/clam.vim' + +" Multiple cursors for simultaneous edits. " NOTE: use to run miltiple cursors not Plugin 'terryma/vim-multiple-cursors' +" Visualize buffers +Plugin 'vim-airline/vim-airline' +Plugin 'vim-airline/vim-airline-themes' + call vundle#end() " required filetype plugin indent on " required -" To ignore plugin indent changes, instead use: -"filetype plugin on -" -" Brief help -" :PluginList - lists configured plugins -" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate -" :PluginSearch foo - searches for foo; append `!` to refresh local cache -" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal -" -" see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line " -- END: Vundle config -- +" Airline Settings +" Enables the list of buffers. +let g:airline#extensions#tabline#enabled = 1 + +" Shows the filename only. +let g:airline#extensions#tabline#fnamemod = ':t' + +" Allow glyphs in airline +let g:airline_powerline_fonts = 1 + + +" It's the twenty-first century...no swaps. set noswapfile -set grepprg=ack\ -k +" Changes to character. +let mapleader = " " + + +" Supports mouse interaction. +set mouse=a " backspace settings @@ -70,7 +89,7 @@ set list set listchars=eol:¶,trail:~,nbsp:␣ -" Keeps everything concealed at all times. Even when my cursor is on the word. +" Keeps everything concealed at all times. Even when cursor is on the word. set conceallevel=1 set concealcursor=nvic @@ -92,51 +111,36 @@ let g:UltiSnipsExpandTrigger="" " let g:UltiSnipsJumpBackwardTrigger="" -" keyword completion -inoremap ;; - - -" remap lwi -inoremap lWi - -" TODO: debug why repetition is needed -inoremap bi -inoremap Bi - - -" set -o emacs line-editor defaults +" Conventional Emacs line-editor defaults inoremap I inoremap A -" vs and sp keybinding +" Manage Vertical and Horizontal splits nnoremap vs :vs nnoremap vv :vs nnoremap sp :sp nnoremap ss :sp -" Remap window keybinding -nnoremap +" Buffer creation and management +" Buffer movement +nnoremap :1bnext +nnoremap :1bprevious + +" Buffer creation +nnoremap :enew + +" Buffer deletion +nnoremap bq :bp bd # -" tab movement bindings -nnoremap gT -nnoremap gt - - -" make Y do what is intuitive given D, etc. +" make Y do what is intuitive given: +" D: deletes until EOL +" C: changes until EOL nnoremap Y y$ -" new tab keybinding -nnoremap :tabnew -inoremap :tabnew -vnoremap :tabnew - - " flip number keys to their shift+ counterparts nnoremap t1 t! nnoremap t2 t@ @@ -210,13 +214,6 @@ nnoremap k nnoremap :e -" resize vertical and horizontal splits -nnoremap :vertical resize +3 -nnoremap :vertical resize -3 -nnoremap :resize +3 -nnoremap :resize -3 - - " -- Syntastic Settings -- set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} @@ -236,13 +233,7 @@ set expandtab set shiftwidth=2 syntax enable - -if has('gui_running') - set background=light -else - set background=dark -endif - +set background=dark colorscheme solarized set t_Co=255 @@ -256,30 +247,27 @@ highlight Comment cterm=italic inoremap lC -" Ensure that
is "," character -let mapleader = "," - - " Define highlighting groups -highlight InterestingWord1 ctermbg=Cyan ctermfg=Black -highlight InterestingWord2 ctermbg=Yellow ctermfg=Black +" NOTE: The ANSII aliases for colors will change when iTerm2 settings are +" changed. +highlight InterestingWord1 ctermbg=White ctermfg=Black +highlight InterestingWord2 ctermbg=Blue ctermfg=Black highlight InterestingWord3 ctermbg=Magenta ctermfg=Black - " h1 highlighting -nnoremap h1 :execute 'match InterestingWord1 /\<\>/' -nnoremap xh1 :execute 'match none' +nnoremap 1 :execute 'match InterestingWord1 /\<\>/' +nnoremap x1 :execute 'match none' " h2 highlighting -nnoremap h2 :execute '2match InterestingWord2 /\<\>/' -nnoremap xh2 :execute '2match none' +nnoremap 2 :execute '2match InterestingWord2 /\<\>/' +nnoremap x2 :execute '2match none' " h3 highlighting -nnoremap h3 :execute '3match InterestingWord3 /\<\>/' -nnoremap xh3 :execute '3match none' +nnoremap 3 :execute '3match InterestingWord3 /\<\>/' +nnoremap x3 :execute '3match none' "clear all highlighted groups -nnoremap xhh :execute 'match none' :execute '2match none' :execute '3match none' +nnoremap xx :execute 'match none' :execute '2match none' :execute '3match none' " pasteboard copy & paste @@ -291,16 +279,35 @@ nnoremap o"+p vnoremap "+p -" add 80 character wrap line -highlight OverLength ctermbg=red ctermfg=white guibg=#592929 +" Manage 80 char line limits +highlight OverLength ctermbg=White ctermfg=Black match OverLength /\%81v.\+/ +set wrap! + + +" Toggle word-wrapping +nnoremap w :set wrap! + + +" Resize split to 10,20,...,100 chars +nnoremap 1 :vertical resize 10 +nnoremap 2 :vertical resize 20 +nnoremap 3 :vertical resize 30 +nnoremap 4 :vertical resize 40 +nnoremap 5 :vertical resize 50 +nnoremap 6 :vertical resize 60 +nnoremap 7 :vertical resize 70 +nnoremap 8 :vertical resize 80 +nnoremap 9 :vertical resize 90 +nnoremap 0 :vertical resize 100 " map jj to imap jj -" map ctrl + n to :NERDTree -map :NERDTreeToggle + +" View Directory tree with ctrl + \ +nnoremap :NERDTreeToggle " BOL and EOL @@ -318,11 +325,22 @@ autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e set guifont=Operator\ Mono:h16 -" -- fuzzy-finder -- +" CtrlP Config. set runtimepath^=~/.vim/bundle/ctrlp.vim -let g:ctrlp_map = '' +" let g:ctrlp_map = '' let g:ctrlp_cmd = 'CtrlP' -let g:ctrlp_custom_ignore = { - \ 'dir': 'node_modules' - \ } + +" Maps CtrlP to leader to future-proof config. +nnoremap p :CtrlP + +" Fuzzy-finds files within cwd. +" nnoremap pf :CtrlP +" Fuzzy-finds files within open buffers. +" nnoremap pb :CtrlPBuffer + +" Ignores dirs and files +let g:ctrlp_custom_ignore = { + \ 'dir': 'node_modules', + \ 'file': '\v\.(exe|dll|png|jpg|jpeg)$' +\}