123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- call plug#begin('~/.vim/plugged')
- Plug 'tpope/vim-sensible'
- Plug 'tpope/vim-sleuth'
- Plug 'tpope/vim-fugitive'
- Plug 'tpope/vim-surround'
- Plug 'bling/vim-airline'
- Plug 'mhinz/vim-signify'
- Plug 'sjl/gundo.vim'
- Plug 'Shougo/unite.vim'
- Plug 'Shougo/vimproc.vim', {'do' : 'make'}
- Plug 'EinfachToll/DidYouMean'
- Plug 'diepm/vim-rest-console'
- Plug 'idanarye/vim-merginal'
- Plug 'vimwiki/vimwiki'
- Plug 'vim-scripts/dbext.vim', {'for': 'sql'}
- Plug 'cespare/vim-toml'
- if executable('lein')
- Plug 'guns/vim-sexp'
- Plug 'tpope/vim-sexp-mappings-for-regular-people'
- Plug 'tpope/vim-fireplace', {'for': 'clojure'}
- endif
- if executable('sbt')
- Plug 'derekwyatt/vim-scala'
- endif
- if executable('kotlin')
- Plug 'udalov/kotlin-vim'
- endif
- if executable('ansible')
- Plug 'pearofducks/ansible-vim'
- endif
- if executable('rustc')
- Plug 'rust-lang/rust.vim'
- endif
- if executable('npm')
- Plug 'pangloss/vim-javascript'
- Plug 'mxw/vim-jsx'
- endif
- if executable('qml')
- Plug 'peterhoeg/vim-qml'
- endif
- Plug 'trusktr/seti.vim'
- call plug#end()
- " ----- plugin settings ------
- let g:signify_vcs_list = [ 'git' ]
- let g:jsx_ext_required = 0
- let g:unite_enable_auto_select = 0
- let g:airline_left_sep=''
- let g:airline_right_sep=''
- let g:vimwiki_list = [{'path': '~/.root/home/wiki'}]
- " use rg or ag if present
- if executable('rg')
- let g:unite_source_rec_async_command =
- \ ['rg', '--follow', '--hidden', '--files']
- let g:unite_source_grep_command = 'rg'
- let g:unite_source_grep_default_opts = '-i --vimgrep --hidden'
- let g:unite_source_grep_recursive_opt = ''
- elseif executable('ag')
- let g:unite_source_rec_async_command =
- \ ['ag', '--follow', '--nocolor', '--nogroup',
- \ '--hidden', '-g', '']
- let g:unite_source_grep_command = 'ag'
- let g:unite_source_grep_default_opts = '-i --vimgrep --hidden'
- let g:unite_source_grep_recursive_opt = ''
- 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)
- inoremap <silent><buffer><expr> <C-s> unite#do_action('split')
- inoremap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
- nnoremap <silent><buffer><expr> s unite#do_action('split')
- nnoremap <silent><buffer><expr> v unite#do_action('vsplit')
- endfunction
- call unite#custom#profile('default', 'context', {
- \ 'ignorecase': 1,
- \ 'prompt': '> ',
- \ 'direction': 'botright',
- \ })
- " ------ settings ------
- " change terminal title
- set title
- " xdg-ish settings
- set undodir=~/.cache/vim/undo,.
- set backupdir=~/.cache/vim/backup,.
- set directory=~/.cache/vim/swap//,.
- " default indentation
- set shiftwidth=2
- set tabstop=4
- set expandtab
- " permanent undo history
- set undofile
- " 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 -buffer-name=files -start-insert file_rec/async<cr>
- nnoremap <C-O> :Unite -buffer-name=buffers -start-insert buffer<cr>
- imap <C-W> <ESC><C-W>
- nnoremap <C-T>h :tabprev<cr>
- nnoremap <C-T>l :tabnext<cr>
- " grepper
- nnoremap <Leader>f :Unite grep:.<CR>
- " git
- nnoremap <Leader>gs :Gstatus<CR>
- nnoremap <Leader>gb :Merginal<CR>
- " undo tree
- nnoremap <Leader>ut :GundoToggle<CR>
- " vimrc
- nnoremap <Leader>ve :vsplit $MYVIMRC<CR>
- nnoremap <Leader>vs :source $MYVIMRC<CR>
- " ------ nvim specific ------
- if has('nvim')
- set inccommand=split
- let g:airline_theme_patch_func = 'AirlineThemePatch'
- function! AirlineThemePatch(palette)
- let a:palette.terminal = copy(a:palette.insert)
- endfunction
- let g:terminal_scrollback_buffer_size = 10000
- tnoremap <C-j><C-j> <C-\><C-N>
- tmap <C-T> <C-\><C-N><C-T>
- tmap <C-W> <C-\><C-N><C-W>
- tmap <C-P> <C-\><C-N><C-P>
- tmap <C-O> <C-\><C-N><C-O>
- tnoremap <C-V><C-V><C-V> <C-V><C-V>
- tnoremap <C-V><C-V> <C-V>
- tnoremap <C-V> <C-\><C-N>"+pi
- autocmd BufWinEnter,WinEnter term://* startinsert
- nnoremap <Leader>tv :vsp term://zsh<CR>
- nnoremap <Leader>to :term<CR>
- endif
- augroup formatting
- au!
- " strip trailing whitespace
- autocmd BufWritePre * :%s/\s\+$//e
- augroup end
- colorscheme seti
- if filereadable(expand('~/.vimrc.local'))
- source ~/.vimrc.local
- endif
|