.vimrc 1.8 KB

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