1
0

.vimrc 1.8 KB

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