.vimrc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 'trusktr/seti.vim'
  8. call plug#end()
  9. let g:signify_vcs_list = [ 'git' ]
  10. " ------ settings ------
  11. " default indentation
  12. set shiftwidth=2
  13. set tabstop=4
  14. set expandtab
  15. " permanent undo history
  16. set undofile
  17. set undodir=~/.vim/undo
  18. " allow switching buffers
  19. set hidden
  20. " always scroll
  21. set scrolloff=99
  22. " show line numbers
  23. set number
  24. set relativenumber
  25. " set wordwrap indent
  26. set nowrap
  27. set linebreak
  28. if exists("&breakindent")
  29. set breakindent
  30. set breakindentopt=shift:2,sbr
  31. endif
  32. " show whitespace
  33. set list
  34. " make a new copy of the file for backup
  35. " setting to no or auto messes with filewatchers
  36. set backupcopy=yes
  37. " ------ key bindings ------
  38. " ; as :
  39. nnoremap ; :
  40. vnoremap ; :
  41. " allow <ESC> via jj in insert mode
  42. inoremap jj <ESC>
  43. " fix j/k with wraps
  44. nnoremap j gj
  45. nnoremap k gk
  46. vnoremap j gj
  47. vnoremap k gk
  48. augroup formatting
  49. au!
  50. " strip trailing whitespace
  51. autocmd BufWritePre * :%s/\s\+$//e
  52. augroup end
  53. colorscheme seti