diff options
author | yushyin <yushyin@saga> | 2016-03-02 00:19:14 +0100 |
---|---|---|
committer | yushyin <yushyin@saga> | 2016-11-27 19:05:22 +0100 |
commit | abf7d02e9f9aaf1585c7cd530e3e91bd5b4f8cef (patch) | |
tree | b89c9ede837cb06670c61b59bb043bcb7588fb73 | |
parent | 1e934844e94acfcba419f2f02d3b75ed50f763c3 (diff) | |
download | dotfiles-abf7d02e9f9aaf1585c7cd530e3e91bd5b4f8cef.tar.gz dotfiles-abf7d02e9f9aaf1585c7cd530e3e91bd5b4f8cef.tar.xz |
Vim: Replace neobundle by dein
-rw-r--r-- | vim/dein.toml | 126 | ||||
-rw-r--r-- | vim/neobundle.toml | 130 | ||||
-rw-r--r-- | vim/vimrc | 87 |
3 files changed, 167 insertions, 176 deletions
diff --git a/vim/dein.toml b/vim/dein.toml new file mode 100644 index 0000000..8ec458e --- /dev/null +++ b/vim/dein.toml @@ -0,0 +1,126 @@ +[[plugins]] +repo = 'Shougo/dein.vim' + +[[plugins]] +repo = 'Shougo/vimproc.vim' +build = 'make' + +[[plugins]] +repo = 'Shougo/unite.vim' +lazy = 1 +on_cmd = 'Unite' + +[[plugins]] +repo = 'Shougo/neomru.vim' +lazy = 1 +on_source = 'unite.vim' + +[[plugins]] +repo = 'Shougo/vimshell.vim' +lazy = 1 +on_cmd = 'VimShell' + +[[plugins]] +repo = 'Shougo/vimfiler.vim' +lazy = 0 + +[[plugins]] +repo = 'chriskempson/base16-vim' + +[[plugins]] +repo = 'tpope/vim-unimpaired' +lazy = 1 +on_i = 1 + +[[plugins]] +repo = 'cespare/vim-toml' + +[[plugins]] +repo = 'ledger/vim-ledger' + +[[plugins]] +repo = 'vim-scripts/a.vim' +lazy = 1 +on_ft = ['c', 'cpp'] + +[[plugins]] +repo = 'Rip-Rip/clang_complete.git' +lazy = 1 +on_ft = ['c', 'cpp'] + +[[plugins]] +repo = 'Twinside/vim-hoogle' +lazy = 1 +external_commands = 'hoogle' +on_ft = ['haskell', 'lhaskell', 'chaskell'] + +[[plugins]] +repo = 'eagletmt/ghcmod-vim' +lazy = 1 +external_commands = 'ghc-mod' +on_ft = ['haskell', 'lhaskell', 'chaskell'] + +[[plugins]] +repo = 'eagletmt/neco-ghc' +lazy = 1 +external_commands = 'ghc-mod' +on_ft = ['haskell', 'lhaskell', 'chaskell'] + +[[plugins]] +repo = 'ujihisa/unite-haskellimport' +lazy = 1 +external_commands = 'hoogle' + +[[plugins]] +repo = 'rust-lang/rust.vim' +lazy = 1 +on_ft = 'rust' + +[[plugins]] +repo = 'racer-rust/vim-racer' +on_ft = 'rust' + +[[plugins]] +repo = 'MarcWeber/vim-addon-local-vimrc' + +[[plugins]] +repo = 'Shougo/vinarise.vim' +on_cmd = 'Vinarise' + +[[plugins]] +repo = 'neomake/neomake' +lazy = 1 +on_cmd = 'Neomake' + +[[plugins]] +repo = 'lambdalisue/vim-gita' +lazy = 1 +on_cmd = 'Gita' + +[[plugins]] +repo = 'Shougo/neosnippet.vim' +lazy = 1 + [plugins.on_map] + i = '<Plug>' + +[[plugins]] +repo = 'Shougo/neosnippet-snippets' +lazy = 1 +on_source = 'neosnippet.vim' + +[[plugins]] +repo = 'junegunn/vim-easy-align' +lazy = 1 +on_cmd = ['EasyAlign', 'LiveEasyAlign'] +on_map = '<Plug>(EasyAlign)' + +[[plugins]] +repo = 'kana/vim-operator-user' +lazy = 1 +on_source = 'vim-operator-surround' + +[[plugins]] +repo = 'rhysd/vim-operator-surround' +lazy = 1 + [plugins.on_map] + n = '<Plug>' diff --git a/vim/neobundle.toml b/vim/neobundle.toml deleted file mode 100644 index c7aea3a..0000000 --- a/vim/neobundle.toml +++ /dev/null @@ -1,130 +0,0 @@ -[[plugins]] -repository = 'Shougo/neobundle.vim' -fetch = 1 - -[[plugins]] -repository = 'Shougo/vimproc.vim' - [plugins.build] - linux = 'make' - -[[plugins]] -repository = 'Shougo/unite.vim' -lazy = 1 - [plugins.on_cmd] - name = 'Unite' - complete = 'customlist,unite#complete_source' - -[[plugins]] -repository = 'Shougo/neomru.vim' -lazy = 1 -on_source = 'unite.vim' - -[[plugins]] -repository = 'Shougo/vimshell.vim' -lazy = 1 - [plugins.on_cmd] - name = 'VimShell' - complete = 'customlist,vimshell#complete' - -[[plugins]] -repository = 'Shougo/vimfiler.vim' -lazy = 0 - -[[plugins]] -repository = 'chriskempson/base16-vim' - -[[plugins]] -repository = 'tpope/vim-unimpaired' -lazy = 1 -on_i = 1 - -[[plugins]] -repository = 'cespare/vim-toml' - -[[plugins]] -repository = 'ledger/vim-ledger' - -[[plugins]] -repository = 'vim-scripts/a.vim' -lazy = 1 -on_ft = ['c', 'cpp'] - -[[plugins]] -repository = 'Rip-Rip/clang_complete.git' -lazy = 1 -on_ft = ['c', 'cpp'] - -[[plugins]] -repository = 'Twinside/vim-hoogle' -lazy = 1 -external_commands = 'hoogle' -on_ft = ['haskell', 'lhaskell', 'chaskell'] - -[[plugins]] -repository = 'eagletmt/ghcmod-vim' -lazy = 1 -external_commands = 'ghc-mod' -on_ft = ['haskell', 'lhaskell', 'chaskell'] - -[[plugins]] -repository = 'eagletmt/neco-ghc' -lazy = 1 -external_commands = 'ghc-mod' -on_ft = ['haskell', 'lhaskell', 'chaskell'] - -[[plugins]] -repository = 'ujihisa/unite-haskellimport' -lazy = 1 -external_commands = 'hoogle' - -[[plugins]] -repository = 'rust-lang/rust.vim' -lazy = 1 -on_ft = 'rust' - -[[plugins]] -repository = 'racer-rust/vim-racer' -on_ft = 'rust' - -[[plugins]] -repository = 'MarcWeber/vim-addon-local-vimrc' - -[[plugins]] -repository = 'Shougo/vinarise.vim' -on_cmd = 'Vinarise' - -[[plugins]] -repository = 'neomake/neomake' -lazy = 1 -on_cmd = 'Neomake' - -[[plugins]] -repository = 'lambdalisue/vim-gita' -lazy = 1 -on_cmd = 'Gita' - -[[plugins]] -repository = 'Shougo/neosnippet.vim' -lazy = 1 -on_map = ['i', '<Plug>'] - -[[plugins]] -repository = 'Shougo/neosnippet-snippets' -lazy = 1 -on_source = 'neosnippet.vim' - -[[plugins]] -repository = 'junegunn/vim-easy-align' -lazy = 1 -on_cmd = ['EasyAlign', 'LiveEasyAlign'] -on_map = '<Plug>(EasyAlign)' - -[[plugins]] -repository = 'kana/vim-operator-user' -lazy = 1 -on_source = 'vim-operator-surround' - -[[plugins]] -repository = 'rhysd/vim-operator-surround' -lazy = 1 -on_map = ['n', '<Plug>'] @@ -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 |