vimrc 1.84 KB
Newer Older
Dian Fay's avatar
Dian Fay committed
1 2 3 4 5
runtime plugins.vim
runtime options.vim
runtime statusline.vim
runtime mappings.vim
runtime! functions/*.vim
Dian Fay's avatar
Dian Fay committed
6

Dian Fay's avatar
recolor  
Dian Fay committed
7
colorscheme warm-dark
Dian Fay's avatar
Dian Fay committed
8

Dian Fay's avatar
Dian Fay committed
9 10 11
"""""""""""""""""
" custom commands

12
command! W w !sudo tee % > /dev/null
13 14 15
command! C w !xsel -i -b
command! CC %w !xsel -i -b
command! P r !xsel -o -b
16
command! J %!python -m json.tool
Dian Fay's avatar
Dian Fay committed
17 18
" :K      kill buffer (functions/kwbd.vim)
" :F[n]   delete n surrounding lines (functions/unfunc.vim)
Dian Fay's avatar
Dian Fay committed
19

Dian Fay's avatar
Dian Fay committed
20 21 22 23 24 25 26
"""""""""""""""
" startup tasks

let s:undos = split(globpath(&undodir, '*'), "\n")
call filter(s:undos, 'getftime(v:val) < localtime() - (60 * 60 * 24 * 90)')
call map(s:undos, 'delete(v:val)')

Dian Fay's avatar
Dian Fay committed
27 28 29 30 31 32 33 34 35 36
"""""""
" hooks

augroup java_tabs
  autocmd!
  autocmd FileType groovy setlocal tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
  autocmd FileType java setlocal tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
  autocmd BufNewFile,BufReadPre pom.xml setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab
  autocmd BufReadPost Jenkinsfile set syntax=groovy
augroup end
Dian Fay's avatar
Dian Fay committed
37

Dian Fay's avatar
Dian Fay committed
38
augroup i3config_ft_detection
Dian Fay's avatar
Dian Fay committed
39 40 41
  autocmd!
  autocmd BufNewFile,BufReadPre ~/.config/i3/config set filetype=i3config
  autocmd BufNewFile,BufReadPre ~/.dotfiles/i3/config set filetype=i3config
Dian Fay's avatar
Dian Fay committed
42 43
augroup end

Dian Fay's avatar
Dian Fay committed
44 45 46 47 48
augroup misc_syntaxes
  autocmd!
  autocmd BufReadPost .eslintrc set syntax=json
  autocmd BufReadPost *.cql set syntax=sql
  autocmd BufReadPost *.sgml set syntax=xml
Dian Fay's avatar
Dian Fay committed
49
  autocmd BufReadPost *.sls set syntax=yaml
Dian Fay's avatar
Dian Fay committed
50
  autocmd BufReadPost *.pug set foldmethod=indent
Dian Fay's avatar
Dian Fay committed
51
augroup end
Dian Fay's avatar
Dian Fay committed
52

Dian Fay's avatar
Dian Fay committed
53 54 55 56
augroup lint_on_write_or_switch
  autocmd!
  autocmd BufWritePost,BufEnter * Neomake
augroup end
Dian Fay's avatar
Dian Fay committed
57

58 59 60 61 62
augroup window_changes
  autocmd!
  autocmd VimResized * wincmd =
augroup end

Dian Fay's avatar
Dian Fay committed
63 64 65
augroup reload_vimrc
  autocmd!
  autocmd BufWritePost *.vim,.vimrc,vimrc so $MYVIMRC
66
augroup end
67 68 69 70 71

" augroup disable_current_word_highlight
"   autocmd!
"   autocmd BufAdd *.md setlocal vim_current_word_disabled_in_this_buffer=1
" augroup end