2016-08-13 16:06:49 -04:00
|
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
Plug 'chrisbra/matchit'
|
|
|
|
Plug 'junegunn/fzf'
|
2021-03-31 23:32:22 -04:00
|
|
|
Plug 'moll/vim-bbye'
|
2021-12-21 13:19:10 -05:00
|
|
|
Plug 'ntpeters/vim-better-whitespace'
|
|
|
|
Plug 'tpope/vim-eunuch'
|
2016-08-13 16:06:49 -04:00
|
|
|
Plug 'tpope/vim-surround'
|
2017-10-17 23:47:58 -04:00
|
|
|
Plug 'troydm/zoomwintab.vim'
|
2016-08-13 16:06:49 -04:00
|
|
|
|
|
|
|
" languages
|
|
|
|
Plug 'tpope/vim-rails'
|
|
|
|
Plug 'vim-ruby/vim-ruby'
|
2018-01-03 11:49:50 -05:00
|
|
|
|
2016-08-13 16:06:49 -04:00
|
|
|
call plug#end()
|
2021-12-21 13:19:10 -05:00
|
|
|
|
|
|
|
" SETTINGS
|
2016-08-15 20:25:07 -04:00
|
|
|
filetype plugin indent on
|
2016-08-13 16:06:49 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
set backspace=2 " Backspace over indent, eol, start of insert
|
2016-02-13 21:05:10 -05:00
|
|
|
set cpoptions+=$ " delimit end of change text
|
2021-12-21 13:19:10 -05:00
|
|
|
set endofline " Add newline to end of file
|
|
|
|
set nobackup
|
|
|
|
set noswapfile
|
2016-02-13 21:05:10 -05:00
|
|
|
set nowrap " Disable wrapping by default
|
2021-12-21 13:19:10 -05:00
|
|
|
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
|
|
|
|
|
2016-02-13 21:05:10 -05:00
|
|
|
set hlsearch " Search highlights
|
|
|
|
set ignorecase " Ignore case with search
|
2021-12-21 13:19:10 -05:00
|
|
|
set incsearch " Search as you type
|
2016-02-13 21:05:10 -05:00
|
|
|
set smartcase " Search will not ignore uppercase
|
2021-12-21 13:19:10 -05:00
|
|
|
set wrapscan " Wrapped search
|
|
|
|
|
2013-08-19 19:43:39 -04:00
|
|
|
set number
|
2021-12-21 13:19:10 -05:00
|
|
|
set relativenumber " Relative line numbers
|
|
|
|
|
|
|
|
set textwidth=80
|
|
|
|
set colorcolumn=80,120 " Ruler at line 80, 120
|
|
|
|
|
2013-04-29 02:31:18 -04:00
|
|
|
" Tabs are 2 spaces
|
|
|
|
set tabstop=2
|
|
|
|
set softtabstop=2
|
|
|
|
set shiftwidth=2
|
|
|
|
set expandtab
|
2016-08-13 16:06:49 -04:00
|
|
|
set shiftround " make >> go to next tab
|
2014-05-11 02:48:01 -04:00
|
|
|
|
2014-12-18 16:39:40 -05:00
|
|
|
" consistency is key - Y should act like C, D
|
|
|
|
map Y y$
|
|
|
|
|
2013-10-01 14:36:44 -04:00
|
|
|
" Don't cancel visual mode while indenting
|
|
|
|
vnoremap > >gv
|
|
|
|
vnoremap < <gv
|
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" typo-city
|
|
|
|
:command W w
|
|
|
|
:command Wq wq
|
2014-05-09 01:16:01 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" quick replaceement
|
|
|
|
nmap S :%s//g<LEFT><LEFT>
|
2021-06-03 08:55:20 -04:00
|
|
|
|
2016-08-13 16:06:49 -04:00
|
|
|
" LEADERS
|
2013-04-29 13:32:51 -04:00
|
|
|
let mapleader = ","
|
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
map <Leader>sz :so ~/.vimrc<cr>
|
2013-10-01 14:36:44 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" copy/paste (system buffer)
|
|
|
|
map <Leader>cp "+y
|
|
|
|
map <Leader>pa "+p
|
2013-10-14 00:19:08 -04:00
|
|
|
|
2014-05-08 23:47:44 -04:00
|
|
|
" clear search
|
2013-10-01 14:36:44 -04:00
|
|
|
map <Leader>cs :let @/ = ""<cr>
|
2016-02-11 08:42:06 -05:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" github
|
2020-07-31 07:40:04 -04:00
|
|
|
map <Leader>gg :exe "!hub gist create -o %:p"<cr><cr>
|
2013-04-29 13:32:51 -04:00
|
|
|
|
2016-08-13 16:06:49 -04:00
|
|
|
" PLUGIN CONFIGURATION
|
2021-12-21 13:19:10 -05:00
|
|
|
" fzf
|
|
|
|
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""'
|
|
|
|
noremap <C-p> :FZF<CR>
|
2021-11-02 20:14:26 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" vim-bbye
|
|
|
|
nnoremap <silent> <Leader>bd :Bdelete<CR>
|
2013-10-01 14:36:44 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" vim-better-whitespace
|
|
|
|
highlight ExtraWhitespace ctermbg=red
|
|
|
|
map <Leader>fw :StripWhitespace<cr>
|
2016-08-16 00:27:42 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" vim-eunuch
|
|
|
|
map <Leader>sa :Move %<tab>
|
2017-10-18 10:40:07 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" vim-plug
|
|
|
|
map <Leader>pc :PlugClean<cr>
|
|
|
|
map <Leader>pi :PlugInstall<cr>
|
|
|
|
map <Leader>pu :PlugUpdate<cr>
|
2018-05-30 09:14:30 -04:00
|
|
|
|
2021-12-21 13:19:10 -05:00
|
|
|
" zoomwintab
|
|
|
|
nnoremap <C-w>z :ZoomWinTabToggle<CR>
|
|
|
|
nnoremap <C-w><C-z> :ZoomWinTabToggle<CR>
|
2016-08-16 00:27:42 -04:00
|
|
|
function! ZoomState()
|
2017-10-17 23:47:58 -04:00
|
|
|
if exists('t:zoomwintab')
|
2016-08-16 00:27:42 -04:00
|
|
|
return 'Z'
|
|
|
|
else
|
|
|
|
return ''
|
|
|
|
endif
|
|
|
|
endfunction
|