30 UniteSessionLoad |
30 UniteSessionLoad |
31 endif |
31 endif |
32 endfunc |
32 endfunc |
33 |
33 |
34 func! vimrc#VundleInstallAndBegin() abort |
34 func! vimrc#VundleInstallAndBegin() abort |
35 if !filereadable(g:myvim . '/bundle/vundle/README.md') |
35 let bundlepath = g:myvim . '/bundle' |
|
36 |
|
37 if !filereadable(bundlepath . '/vundle/README.md') |
36 if !executable('git') |
38 if !executable('git') |
37 echo "Can't autoinstall Vundle without git" |
39 echo "Can't autoinstall Vundle without git" |
38 return |
40 return |
39 endif |
41 endif |
40 |
42 |
41 try |
43 if !isdirectory(bundlepath) |
42 call mkdir(g:myvim . '/bundle', 'p') |
44 call mkdir(bundlepath, 'p') |
43 catch |
45 endif |
44 endtry |
46 exec 'cd ' . bundlepath |
45 exec 'cd ' . g:myvim . '/bundle' |
|
46 silent !git clone --depth 1 https://github.com/gmarik/vundle |
47 silent !git clone --depth 1 https://github.com/gmarik/vundle |
47 cd - |
48 cd - |
48 |
49 |
49 echo "Installed Vundle, run :PluginInstall if desired" |
50 echo "Installed Vundle, run :PluginInstall if desired" |
50 endif |
51 endif |
51 |
52 |
52 let &rtp .= ',' . g:myvim . '/bundle/vundle' |
53 let &rtp .= ',' . bundlepath . '/vundle' |
53 call vundle#begin(g:myvim . '/bundle') |
54 call vundle#begin(bundlepath) |
54 endfunc |
55 endfunc |