1
0

.vimrc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. call plug#begin('~/.vim/plugged')
  2. Plug 'tpope/vim-sensible'
  3. Plug 'tpope/vim-sleuth'
  4. Plug 'tpope/vim-fugitive'
  5. Plug 'tpope/vim-surround'
  6. Plug 'bling/vim-airline'
  7. Plug 'mhinz/vim-signify'
  8. Plug 'sjl/gundo.vim'
  9. Plug 'ctrlpvim/ctrlp.vim'
  10. if executable('lein')
  11. Plug 'guns/vim-sexp'
  12. Plug 'tpope/vim-sexp-mappings-for-regular-people'
  13. Plug 'tpope/vim-fireplace', {'for': 'clojure'}
  14. endif
  15. if executable('sbt')
  16. Plug 'derekwyatt/vim-scala'
  17. endif
  18. if executable('ansible')
  19. Plug 'pearofducks/ansible-vim'
  20. endif
  21. Plug 'trusktr/seti.vim'
  22. call plug#end()
  23. " ----- plugin settings ------
  24. let g:signify_vcs_list = [ 'git' ]
  25. if executable('ag')
  26. " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
  27. " we cd first into the dir so ag will use .agignore correctly
  28. let g:ctrlp_user_command = 'cd %s && ag --nocolor --hidden -g ""'
  29. endif
  30. " ------ settings ------
  31. " xdg-ish settings
  32. set undodir=~/.cache/vim/undo,.
  33. set backupdir=~/.cache/vim/backup,.
  34. set directory=~/.cache/vim/swap,.
  35. " default indentation
  36. set shiftwidth=2
  37. set tabstop=4
  38. set expandtab
  39. " permanent undo history
  40. set undofile
  41. " allow switching buffers
  42. set hidden
  43. " always scroll
  44. set scrolloff=99
  45. " show line numbers
  46. set number
  47. set relativenumber
  48. " set wordwrap indent
  49. set nowrap
  50. set linebreak
  51. if exists("&breakindent")
  52. set breakindent
  53. set breakindentopt=shift:2,sbr
  54. endif
  55. " show whitespace
  56. set list
  57. " make a new copy of the file for backup
  58. " setting to no or auto messes with filewatchers
  59. set backupcopy=yes
  60. " ------ key bindings ------
  61. " ; as :
  62. nnoremap ; :
  63. vnoremap ; :
  64. " allow <ESC> via jj in insert mode
  65. inoremap jj <ESC>
  66. " fix j/k with wraps
  67. nnoremap j gj
  68. nnoremap k gk
  69. vnoremap j gj
  70. vnoremap k gk
  71. " opening ctrlp
  72. nnoremap <C-O> :CtrlPBuffer<cr>
  73. nnoremap <C-T>h :tabprev<cr>
  74. nnoremap <C-T>l :tabnext<cr>
  75. " ------ nvim specific ------
  76. if has('nvim')
  77. let g:airline#themes#dark#palette.terminal = copy(g:airline#themes#dark#palette.insert)
  78. tnoremap <C-j><C-j> <C-\><C-N>
  79. tmap <C-T> <C-\><C-N><C-T>
  80. tmap <C-W> <C-\><C-N><C-W>
  81. tmap <C-P> <C-\><C-N><C-P>
  82. tmap <C-O> <C-\><C-N><C-O>
  83. autocmd BufWinEnter,WinEnter term://* startinsert
  84. endif
  85. augroup formatting
  86. au!
  87. " strip trailing whitespace
  88. autocmd BufWritePre * :%s/\s\+$//e
  89. augroup end
  90. colorscheme seti
  91. if filereadable(expand('~/.vimrc.local'))
  92. source ~/.vimrc.local
  93. endif