Completely reset dotfiles (#2)
This commit is contained in:
parent
4abd1a6ffc
commit
bf26003ab3
38 changed files with 305 additions and 1101 deletions
0
vim/.config/vim/undo/.gitinclude
Normal file
0
vim/.config/vim/undo/.gitinclude
Normal file
202
vim/.vimrc
202
vim/.vimrc
|
@ -1,112 +1,51 @@
|
|||
" PLUGINS
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
" colors
|
||||
Plug 'altercation/vim-colors-solarized'
|
||||
Plug 'rakr/vim-one'
|
||||
|
||||
" keepers
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'ntpeters/vim-better-whitespace'
|
||||
Plug 'chrisbra/matchit'
|
||||
Plug 'junegunn/fzf'
|
||||
Plug 'moll/vim-bbye'
|
||||
Plug 'tpope/vim-eunuch' " move files
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'ntpeters/vim-better-whitespace'
|
||||
Plug 'tpope/vim-eunuch'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'troydm/zoomwintab.vim'
|
||||
Plug 'chrisbra/matchit'
|
||||
|
||||
" languages
|
||||
Plug 'leafgarland/typescript-vim'
|
||||
Plug 'tpope/vim-markdown'
|
||||
Plug 'tpope/vim-rails'
|
||||
Plug 'vim-ruby/vim-ruby'
|
||||
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
|
||||
Plug 'hashivim/vim-terraform'
|
||||
|
||||
" Testing
|
||||
|
||||
call plug#end()
|
||||
|
||||
" SETTINGS
|
||||
filetype plugin indent on
|
||||
|
||||
" STATUS LINE
|
||||
set statusline=
|
||||
set statusline+=%<\ %f%{ZoomState()}
|
||||
set statusline+=\ %m%r%y%w%= " what am i doing here
|
||||
set statusline+=\ Line:\ %l\/%L\ [%p%%]
|
||||
set statusline+=\ Col:\ %v
|
||||
set statusline+=\ Buf:\ #%n
|
||||
set statusline+=\ " trailing space is with purpose
|
||||
|
||||
" OPTIONS
|
||||
set fileformats=unix,mac,dos " File format prefer unix endings
|
||||
set endofline " Add newline at end of file
|
||||
set shellslash " Forward slashes
|
||||
set nobackup " No backup files
|
||||
set noswapfile " Hope for the best
|
||||
set formatoptions=crq
|
||||
set textwidth=80
|
||||
set cpoptions+=$ " delimit end of change text
|
||||
set laststatus=2 " Always show status line
|
||||
set showmode " Show current mode
|
||||
set history=100 " History length
|
||||
set nowrap " Disable wrapping by default
|
||||
set backspace=2 " Backspace over indent, eol, start of insert
|
||||
set hlsearch " Search highlights
|
||||
set wrapscan " Wrapped search
|
||||
set incsearch " Search as you type
|
||||
set ignorecase " Ignore case with search
|
||||
set smartcase " Search will not ignore uppercase
|
||||
set showcmd " Show command as you type
|
||||
set ruler " Show cursor position
|
||||
set autoindent " autoindent AND be smart about it
|
||||
set smartindent
|
||||
set colorcolumn=80,120 " Ruler at line 80, 120
|
||||
set nomodeline
|
||||
set relativenumber " Relative line numbers
|
||||
set number
|
||||
set virtualedit=all " Cursor can go anywhere
|
||||
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 showmatch " Show matching brackets
|
||||
set hidden " Allow unsaved buffers to be hidden
|
||||
set wildcharm=<tab> " Allow use of tab in macros
|
||||
set wildmenu " Command line completion
|
||||
set wildmode=list:longest,full " Better file completion
|
||||
set infercase " Adjust completions to match case
|
||||
set wildignorecase " Ignore case on commandline
|
||||
set autowrite " Save file when focus is lost
|
||||
set updatetime=250 " Make gitgutter autoupdate
|
||||
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
|
||||
" some performance stuff
|
||||
set lazyredraw
|
||||
set ttyfast
|
||||
set synmaxcol=256
|
||||
" Show whitespace markers before cursor in insert mode
|
||||
set list listchars=tab:\ \ ,trail:·
|
||||
" Ignore stuff
|
||||
set wildignore+=*/\.git/*
|
||||
" Java
|
||||
" set wildignore+=*/build/*,*/grade/*,*\.class
|
||||
" Frontend
|
||||
set wildignore+=*/node_modules/*,*/bower_components/*,*/dist/*
|
||||
" Persistent undo stuff
|
||||
if has('persistent_undo')
|
||||
set undolevels=5000
|
||||
set undodir=$HOME/.vim/undo
|
||||
set undofile
|
||||
endif
|
||||
|
||||
" KEYBINDS
|
||||
" quick replaceement
|
||||
nmap S :%s//g<LEFT><LEFT>
|
||||
|
||||
" consistency is key - Y should act like C, D
|
||||
map Y y$
|
||||
|
@ -115,70 +54,51 @@ map Y y$
|
|||
vnoremap > >gv
|
||||
vnoremap < <gv
|
||||
|
||||
" Make fzf act like ctrlp
|
||||
nnoremap <C-p> :Files<CR>
|
||||
" typo-city
|
||||
:command W w
|
||||
:command Wq wq
|
||||
|
||||
" ZoomWin
|
||||
nnoremap <C-w>z :ZoomWinTabToggle<CR>
|
||||
nnoremap <C-w><C-z> :ZoomWinTabToggle<CR>
|
||||
|
||||
" Fugitive
|
||||
autocmd FileType fugitiveblame nmap <buffer> q gq
|
||||
command! Gblame :G blame
|
||||
" quick replaceement
|
||||
nmap S :%s//g<LEFT><LEFT>
|
||||
|
||||
" LEADERS
|
||||
let mapleader = ","
|
||||
|
||||
" tab swaps
|
||||
map <Leader>2 :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab<cr>
|
||||
map <Leader>4 :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab<cr>
|
||||
map <Leader>a :set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab<cr>
|
||||
map <Leader>sz :so ~/.vimrc<cr>
|
||||
|
||||
" plugin
|
||||
" copy/paste (system buffer)
|
||||
map <Leader>cp "+y
|
||||
map <Leader>pa "+p
|
||||
|
||||
" clear search
|
||||
map <Leader>cs :let @/ = ""<cr>
|
||||
|
||||
" github
|
||||
map <Leader>gg :exe "!hub gist create -o %:p"<cr><cr>
|
||||
|
||||
" PLUGIN CONFIGURATION
|
||||
" fzf
|
||||
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""'
|
||||
noremap <C-p> :FZF<CR>
|
||||
|
||||
" vim-bbye
|
||||
nnoremap <silent> <Leader>bd :Bdelete<CR>
|
||||
|
||||
" vim-better-whitespace
|
||||
highlight ExtraWhitespace ctermbg=red
|
||||
map <Leader>fw :StripWhitespace<cr>
|
||||
|
||||
" vim-eunuch
|
||||
map <Leader>sa :Move %<tab>
|
||||
|
||||
" vim-plug
|
||||
map <Leader>pc :PlugClean<cr>
|
||||
map <Leader>pi :PlugInstall<cr>
|
||||
map <Leader>pu :PlugUpdate<cr>
|
||||
|
||||
" clear search
|
||||
map <Leader>cs :let @/ = ""<cr>
|
||||
" bclose
|
||||
nnoremap <silent> <Leader>bd :Bdelete<CR>
|
||||
|
||||
" other
|
||||
map <Leader>cp "+y
|
||||
map <Leader>pa "+p
|
||||
map <Leader>fj :%!python -m json.tool<cr>
|
||||
map <Leader>fw :StripWhitespace<cr>
|
||||
map <Leader>gg :exe "!hub gist create -o %:p"<cr><cr>
|
||||
map <Leader>gi :GoImports<cr>
|
||||
map <Leader>pm :set paste!<cr>
|
||||
map <Leader>sa :Move %<tab>
|
||||
map <Leader>sb :exe "!code --goto %:p:" . line(".")<cr><cr>
|
||||
map <Leader>se :e ~/.vimrc<cr>
|
||||
map <Leader>sc :pclose<cr>
|
||||
map <Leader>sw :SudoWrite<cr>
|
||||
map <Leader>sz :so ~/.vimrc<cr>
|
||||
|
||||
" PLUGIN CONFIGURATION
|
||||
set cursorline " Highlight current line
|
||||
set cursorcolumn " Highlight current column
|
||||
|
||||
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
|
||||
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
|
||||
set termguicolors
|
||||
syntax enable
|
||||
colorscheme one
|
||||
|
||||
highlight ExtraWhitespace ctermbg=196
|
||||
|
||||
" fzf
|
||||
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""'
|
||||
let g:fzf_preview_window = []
|
||||
|
||||
" terraform
|
||||
let g:terraform_align=1
|
||||
|
||||
" ZoomWin
|
||||
" zoomwintab
|
||||
nnoremap <C-w>z :ZoomWinTabToggle<CR>
|
||||
nnoremap <C-w><C-z> :ZoomWinTabToggle<CR>
|
||||
function! ZoomState()
|
||||
if exists('t:zoomwintab')
|
||||
return 'Z'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue