vimrc (2965B) - Raw
1 if $VIM_PATH != "" 2 let $PATH = $VIM_PATH 3 endif 4 5 syntax on 6 filetype plugin indent on 7 set et ts=4 sw=4 sws=4 nu hlsearch ruler ignorecase smartcase nomodeline bg=dark incsearch 8 set path=**/* grepprg=rg\ --vimgrep grepformat^=%f:%l:%c:%m backspace=2 nojs 9 set laststatus=1 10 nnoremap <Leader>\ gqj 11 command OLD :enew | setl buftype=nofile | 0put =v:oldfiles | nnoremap <buffer> <CR> :e <C-r>=getline('.')<CR><CR> 12 13 let g:gutentags_enabled = 0 14 let g:gutentags_generate_on_new = 0 15 let g:gutentags_cache_dir = '~/.vim/ctags' 16 let b:gutentags_file_list_command = 'git ls-files' 17 18 call matchadd('ColorColumn', '\%81v', 100) 19 " thanks to drew de vault's vimrc, except swearing 20 set mouse=a 21 set backupdir=~/.cache directory=~/.cache 22 "nnoremap Q :grep <cword><CR> 23 nmap gs :grep <cursor><CR> 24 25 " bits from vim-sensible 26 set autoindent smarttab nrformats-=octal 27 nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L> 28 set wildmenu sidescrolloff=5 display+=lastline encoding=utf-8 29 set formatoptions+=j history=1000 tabpagemax=50 sessionoptions-=options 30 31 " so Gdiff and vimdiff output are somewhat readable 32 if &diff 33 syntax off 34 endif 35 36 if has("patch-8.1-0360") 37 set diffopt+=algorithm:patience 38 endif 39 40 "nmap gs :rg :grep <cword> 41 42 " html 43 au FileType html,gohtmltmpl setlocal ts=2 sw=2 sts=2 44 45 " ruby 46 au BufRead,BufNewFile Vagrantfile setfiletype ruby 47 48 " starlark 49 au BufRead,BufNewFile *.star setfiletype python 50 51 " puppet 52 au BufRead,BufNewFile *.pp setfiletype puppet 53 au FileType puppet setlocal ts=2 sw=2 sts=2 syntax=ruby 54 au FileType puppet let g:gutentags_enabled = 1 55 au FileType puppet let b:gutentags_file_list_command = 'git ls-files *.pp' 56 au FileType puppet nnoremap <buffer> <C-]> :call search('\s', 'b')<cr>:call search('\w')<cr>vE<C-]> 57 "au FileType puppet nnoremap <buffer> <C-]> :call search('\s', 'b')<cr>:call search('\w')<cr>:call search('[^a-z:]\|$', 's')<cr>hv`'<C-]> 58 59 " puppet 60 au BufRead,BufNewFile *.j2 setfiletype django 61 62 " avro 63 au BufRead,BufNewFile *.avsc setfiletype json 64 au BufRead,BufNewFile *.avsc setlocal ts=2 sw=2 sts=2 65 66 " redo 67 au BufRead,BufNewFile *.do setfiletype sh 68 69 " go 70 au FileType go setlocal noet 71 au FileType go nnoremap <buffer> <C-]> :GoDef<CR> 72 au FileType go let g:go_template_autocreate = 0 73 au FileType go let g:go_fmt_command = "goimports" 74 let g:go_fmt_command = "goimports" 75 let g:go_fmt_options = { 76 \ 'goimports': '-local selector,bindata,gen,inventory,gopkg.in,google.golang.org,code.uber.internal,thriftrw,thrift,gogoproto,go.uber.org,golang.org,github.com,mock,git.sr.ht,go.etcd.io', 77 \ } 78 let $USEGO111MODULE="off" 79 80 " strace 81 au FileType strace setlocal nonu 82 83 " yaml 84 au FileType yaml setlocal ts=2 sw=2 sts=2 85 86 " sql 87 au FileType sql setlocal formatprg=pg_format\ - 88 au FileType sql setlocal ts=2 sw=2 sts=2 89 let g:loaded_sql_completion = 0 90 let g:omni_sql_no_default_maps = 1 91 92 " mail 93 autocmd BufRead,BufNewFile *mutt-* setfiletype mail 94 95 " TeX 96 au FileType tex setlocal spell spelllang=en_us ts=2 sw=2 sts=2