123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- call plug#begin('~/.vim/plugged')
- Plug 'tpope/vim-sensible'
- Plug 'tpope/vim-sleuth'
- Plug 'tpope/vim-fugitive'
- Plug 'bling/vim-airline'
- Plug 'mhinz/vim-signify'
- Plug 'Shougo/unite.vim'
- Plug 'trusktr/seti.vim'
- call plug#end()
- " ----- plugin settings ------
- let g:signify_vcs_list = [ 'git' ]
- call unite#filters#matcher_default#use(['matcher_fuzzy'])
- " use ag if present
- if executable('ag')
- " we run a wrapper around ag so it respects agignore
- let g:unite_source_rec_async_command = ['sh', expand('~/.vim/ag-unite')]
- endif
- autocmd FileType unite call s:unite_settings()
- function! s:unite_settings()
- " Enable navigation with control-j and control-k in insert mode
- imap <buffer> <C-j> <Plug>(unite_select_next_line)
- imap <buffer> <C-k> <Plug>(unite_select_previous_line)
- endfunction
- " ------ settings ------
- " default indentation
- set shiftwidth=2
- set tabstop=4
- set expandtab
- " permanent undo history
- set undofile
- set undodir=~/.vim/undo
- " allow switching buffers
- set hidden
- " always scroll
- set scrolloff=99
- " show line numbers
- set number
- set relativenumber
- " set wordwrap indent
- set nowrap
- set linebreak
- if exists("&breakindent")
- set breakindent
- set breakindentopt=shift:2,sbr
- endif
- " show whitespace
- set list
- " make a new copy of the file for backup
- " setting to no or auto messes with filewatchers
- set backupcopy=yes
- " ------ key bindings ------
- " ; as :
- nnoremap ; :
- vnoremap ; :
- " allow <ESC> via jj in insert mode
- inoremap jj <ESC>
- " fix j/k with wraps
- nnoremap j gj
- nnoremap k gk
- vnoremap j gj
- vnoremap k gk
- " opening unite
- nnoremap <C-P> :Unite -no-split -buffer-name=files -start-insert file_rec<cr>
- nnoremap <C-O> :Unite -no-split -buffer-name=buffers -start-insert buffer<cr>
- " ------ nvim specific ------
- if has('nvim')
- tnoremap jj <C-\><C-N>
- tnoremap <C-W> <C-\><C-N><C-W>
- nnoremap <C-P> :Unite -no-split -buffer-name=files -start-insert file_rec/neovim<cr>
- endif
- augroup formatting
- au!
- " strip trailing whitespace
- autocmd BufWritePre * :%s/\s\+$//e
- augroup end
- colorscheme seti
|