1
0

.vimrc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 'Shougo/unite.vim'
  8. Plug 'trusktr/seti.vim'
  9. call plug#end()
  10. " ----- plugin settings ------
  11. let g:signify_vcs_list = [ 'git' ]
  12. call unite#filters#matcher_default#use(['matcher_fuzzy'])
  13. " use ag if present
  14. if executable('ag')
  15. " we run a wrapper around ag so it respects agignore
  16. let g:unite_source_rec_async_command = ['sh', expand('~/.vim/ag-unite')]
  17. endif
  18. autocmd FileType unite call s:unite_settings()
  19. function! s:unite_settings()
  20. " Enable navigation with control-j and control-k in insert mode
  21. imap <buffer> <C-j> <Plug>(unite_select_next_line)
  22. imap <buffer> <C-k> <Plug>(unite_select_previous_line)
  23. endfunction
  24. " ------ settings ------
  25. " default indentation
  26. set shiftwidth=2
  27. set tabstop=4
  28. set expandtab
  29. " permanent undo history
  30. set undofile
  31. set undodir=~/.vim/undo
  32. " allow switching buffers
  33. set hidden
  34. " always scroll
  35. set scrolloff=99
  36. " show line numbers
  37. set number
  38. set relativenumber
  39. " set wordwrap indent
  40. set nowrap
  41. set linebreak
  42. if exists("&breakindent")
  43. set breakindent
  44. set breakindentopt=shift:2,sbr
  45. endif
  46. " show whitespace
  47. set list
  48. " make a new copy of the file for backup
  49. " setting to no or auto messes with filewatchers
  50. set backupcopy=yes
  51. " ------ key bindings ------
  52. " ; as :
  53. nnoremap ; :
  54. vnoremap ; :
  55. " allow <ESC> via jj in insert mode
  56. inoremap jj <ESC>
  57. " fix j/k with wraps
  58. nnoremap j gj
  59. nnoremap k gk
  60. vnoremap j gj
  61. vnoremap k gk
  62. " opening unite
  63. nnoremap <C-P> :Unite -no-split -buffer-name=files -start-insert file_rec<cr>
  64. nnoremap <C-O> :Unite -no-split -buffer-name=buffers -start-insert buffer<cr>
  65. " ------ nvim specific ------
  66. if has('nvim')
  67. tnoremap jj <C-\><C-N>
  68. tnoremap <C-W> <C-\><C-N><C-W>
  69. nnoremap <C-P> :Unite -no-split -buffer-name=files -start-insert file_rec/neovim<cr>
  70. endif
  71. augroup formatting
  72. au!
  73. " strip trailing whitespace
  74. autocmd BufWritePre * :%s/\s\+$//e
  75. augroup end
  76. colorscheme seti