call plug#begin('~/.vim/plugged') Plug 'chrisbra/matchit' Plug 'junegunn/fzf' Plug 'moll/vim-bbye' Plug 'ntpeters/vim-better-whitespace' Plug 'tpope/vim-eunuch' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-surround' Plug 'troydm/zoomwintab.vim' " languages Plug 'tpope/vim-rails' Plug 'vim-ruby/vim-ruby' Plug 'hashivim/vim-terraform' call plug#end() " SETTINGS filetype plugin indent on set backspace=2 " Backspace over indent, eol, start of insert set cpoptions+=$ " delimit end of change text set endofline " Add newline to end of file set nobackup set noswapfile set nowrap " Disable wrapping by default set scrolloff=3 " Keep cursor from touching edges set showmode " Show current mode set timeoutlen=500 " Don't wait too long (ambiguous leaders) set virtualedit=all " Cursor can go anywhere set hlsearch " Search highlights set ignorecase " Ignore case with search set incsearch " Search as you type set smartcase " Search will not ignore uppercase set wrapscan " Wrapped search set number set relativenumber " Relative line numbers set textwidth=80 set colorcolumn=80,120 " Ruler at line 80, 120 " Tabs are 2 spaces set tabstop=2 set softtabstop=2 set shiftwidth=2 set expandtab set shiftround " make >> go to next tab " consistency is key - Y should act like C, D map Y y$ " Don't cancel visual mode while indenting vnoremap > >gv vnoremap < " LEADERS let mapleader = "," map sz :so ~/.vimrc " copy/paste (system buffer) map cp "+y map pa "+p " clear search map cs :let @/ = "" " github map gg :exe "!hub gist create -o %:p" " PLUGIN CONFIGURATION " fzf let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""' noremap :FZF " vim-bbye nnoremap bd :Bdelete " vim-better-whitespace highlight ExtraWhitespace ctermbg=red map fw :StripWhitespace " vim-eunuch map sa :Move % " Fugitive autocmd FileType fugitiveblame nmap q gq command! Gblame :G blame map gb :Git blame " vim-plug map pc :PlugClean map pi :PlugInstall map pu :PlugUpdate " zoomwintab nnoremap z :ZoomWinTabToggle nnoremap :ZoomWinTabToggle function! ZoomState() if exists('t:zoomwintab') return 'Z' else return '' endif endfunction