.vimrc 1.9 KB

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