diff options
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 87 |
1 files changed, 41 insertions, 46 deletions
@@ -17,31 +17,39 @@ set backupdir=$XDG_CACHE_HOME/vim/backup,/var/tmp,/tmp set viminfo+=n$XDG_CACHE_HOME/vim/viminfo set rtp=$XDG_CONFIG_HOME/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$XDG_CONFIG_HOME/vim/after -" NeoBundle -let s:bundle_dir = $XDG_DATA_HOME . '/vim/bundle' -let s:neobundle_dir = s:bundle_dir . '/neobundle.vim' -let s:neobundle_repo = 'https://github.com/Shougo/neobundle.vim' -let s:neobundle_toml = $XDG_CONFIG_HOME . '/vim/neobundle.toml' +" dein.vim +let s:dein_base = $XDG_DATA_HOME . '/vim/dein' +let s:dein_repo_path = s:dein_base . '/repos/github.com/Shougo/dein.vim' +let s:dein_repo_url = 'https://github.com/Shougo/dein.vim' +let s:dein_toml = $XDG_CONFIG_HOME . '/vim/dein.toml' let s:plugrc = $XDG_CONFIG_HOME . '/vim/plugrc' -let g:neobundle#cache_file = $XDG_CACHE_HOME . '/vim/neobundlecache' -let &runtimepath.=','.s:neobundle_dir +let &runtimepath.=','.s:dein_repo_path +function! s:hook_source() abort + let l:rcfile = s:plugrc . '/' . g:dein#plugin.normalized_name . '.rc.vim' + let g:dein#plugin.hook_source = "source " . l:rcfile +endfunction + +" dein.vim +let g:dein#types#git#clone_depth = 1 try - call neobundle#begin(s:bundle_dir) -catch /E117:/ " neobundle not installed - execute "silent !git clone " . s:neobundle_repo . " " . s:neobundle_dir - call neobundle#begin(s:bundle_dir) - call neobundle#load_toml(s:neobundle_toml, {}) + if dein#load_state(s:dein_base) + call dein#begin(s:dein_base) + call dein#load_toml(s:dein_toml) + call dein#end() + call dein#save_state() + endif +catch /E117:/ " dein not installed + execute "silent !git clone" s:dein_repo_url s:dein_repo_path + call dein#begin(s:dein_base) + call dein#load_toml(s:dein_toml) set nomore - NeoBundleInstall - call neobundle#end() + call dein#install() + call dein#end() quit endtry -if neobundle#load_cache(s:neobundle_toml) - call neobundle#load_toml(s:neobundle_toml, {}) - NeoBundleSaveCache -endif -if neobundle#tap('unite.vim') + +if dein#tap('unite.vim') nnoremap <leader>g :<C-u>Unite grep \ -auto-preview \ -no-split @@ -53,54 +61,41 @@ if neobundle#tap('unite.vim') nnoremap <leader>r :<C-u>UniteResume \ -no-start-insert \ -force-redraw<CR> - let neobundle#hooks.on_source = s:plugrc . '/unite.rc.vim' - call neobundle#untap() + call s:hook_source() endif -if neobundle#tap('vimfiler.vim') - let neobundle#hooks.on_source = s:plugrc . '/vimfiler.rc.vim' - call neobundle#untap() +if dein#tap('vimfiler.vim') + call s:hook_source() endif -if neobundle#tap('neosnippet.vim') +if dein#tap('neosnippet.vim') let g:neosnippet#snippets_directory = \ $XDG_CONFIG_HOME . '/vim/snippets' imap <C-k> <Plug>(neosnippet_expand_or_jump) smap <C-k> <Plug>(neosnippet_expand_or_jump) xmap <C-k> <Plug>(neosnippet_expand_or_jump) - call neobundle#untap() endif -if neobundle#tap('clang_complete') - let neobundle#hooks.on_source = s:plugrc . '/clang_complete.rc.vim' - call neobundle#untap() +if dein#tap('clang_complete') + call s:hook_source() endif -if neobundle#tap('vim-racer') - function! neobundle#hooks.on_source(bundle) - let $RUST_SRC_PATH= $XDG_DATA_HOME . '/rustc_src_latest/src/' - endfunction - call neobundle#untap() +if dein#tap('vim-racer') + let g:dein#plugin.hook_source = + \ "let $RUST_SRC_PATH= $XDG_DATA_HOME . '/rustc_src_latest/src/'" endif -if neobundle#tap('vim-easy-align') +if dein#tap('vim-easy-align') nmap ga <Plug>(EasyAlign) - call neobundle#untap() endif -if neobundle#tap('vim-operator-surround') +if dein#tap('vim-operator-surround') nmap <silent>sa <Plug>(operator-surround-append) nmap <silent>sd <Plug>(operator-surround-delete) nmap <silent>sr <Plug>(operator-surround-replace) - call neobundle#untap() endif -if neobundle#tap('vim-addon-local-vimrc') +if dein#tap('vim-addon-local-vimrc') let g:local_vimrc = {'names':['.lvimrc'],'hash_fun':'LVRHashOfFile'} - call neobundle#untap() endif -if neobundle#tap('base16-vim') +if dein#tap('base16-vim') set bg=dark let base16colorspace=256 - function! neobundle#hooks.on_post_source(bundle) - colorscheme base16-monokai - endfunction - call neobundle#untap() + colorscheme base16-monokai endif -call neobundle#end() filetype plugin indent on syntax on |