Skip to content

Commit 5c4aa2c

Browse files
author
wklken
committed
fix bug of install, Fixed #24, thx William-Sang
1 parent 3c11636 commit 5c4aa2c

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

install.sh

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
11
#!/bin/bash
22

33
# refer spf13-vim bootstrap.sh`
4-
54
BASEDIR=$(dirname $0)
65
cd $BASEDIR
76
CURRENT_DIR=`pwd`
87

98
lnif() {
10-
if [ ! -e $2 ] ; then
11-
ln -s $1 $2
12-
fi
13-
if [ -L $2 ] ; then
14-
ln -sf $1 $2
9+
if [ -e "$1" ]; then
10+
ln -sf "$1" "$2"
1511
fi
1612
}
1713

18-
echo "backing up current vim config"
14+
echo "Step1: backing up current vim config"
1915
today=`date +%Y%m%d`
2016
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do [ -e $i ] && [ ! -L $i ] && mv $i $i.$today; done
2117
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do [ -L $i ] && unlink $i ; done
2218

2319

24-
echo "setting up symlinks"
20+
echo "Step2: setting up symlinks"
2521
lnif $CURRENT_DIR/vimrc $HOME/.vimrc
2622
lnif $CURRENT_DIR/vimrc.bundles $HOME/.vimrc.bundles
27-
lnif $CURRENT_DIR/ $HOME/.vim
28-
23+
lnif "$CURRENT_DIR/" "$HOME/.vim"
2924

30-
if [ ! -e $CURRENT_DIR/vundle ]; then
25+
echo "Step3: install vundle"
26+
if [ ! -e $CURRENT_DIR/bundle/vundle ]; then
3127
echo "Installing Vundle"
3228
git clone https://github.com/gmarik/vundle.git $CURRENT_DIR/bundle/vundle
29+
else
30+
echo "Upgrade Vundle"
31+
cd "$HOME/.vim/bundle/vundle" && git pull origin master
3332
fi
3433

35-
36-
echo "update/install plugins using Vundle"
34+
echo "Step4: update/install plugins using Vundle"
3735
system_shell=$SHELL
3836
export SHELL="/bin/sh"
39-
vim -u $CURRENT_DIR/vimrc +BundleInstall! +BundleClean +qall
37+
vim -u $HOME/.vimrc.bundles +BundleInstall! +BundleClean +qall
4038
export SHELL=$system_shell
4139

4240

43-
44-
echo "compile YouCompleteMe"
45-
echo "if error,you need to compile it yourself"
41+
echo "Step5: compile YouCompleteMe"
42+
echo "It will take a long time, juse be patient!"
43+
echo "If error,you need to compile it yourself"
4644
echo "cd $CURRENT_DIR/bundle/YouCompleteMe/ && bash -x install.sh --clang-completer"
4745
cd $CURRENT_DIR/bundle/YouCompleteMe/
4846
bash -x install.sh --clang-completer
@@ -57,3 +55,5 @@ if [ ! -d /tmp/vimundo ]
5755
then
5856
mkdir -p /tmp/vimundo
5957
fi
58+
59+
echo "Install Done!"

vimrc

+1-8
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ let g:mapleader = ','
3030
" 开启语法高亮
3131
syntax enable
3232

33-
" configure Vundle
34-
filetype on " without this vim emits a zero exit status, later, because of :ft off
35-
filetype off " required! turn off
36-
set rtp+=~/.vim/bundle/vundle/
37-
call vundle#rc()
3833

3934
" install Vundle bundles
4035
if filereadable(expand("~/.vimrc.bundles"))
@@ -64,8 +59,6 @@ filetype plugin on
6459
"启动自动补全
6560
filetype plugin indent on
6661

67-
"非兼容vi模式。去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限
68-
set nocompatible
6962
set autoread " 文件修改之后自动载入。
7063
set shortmess=atI " 启动的时候不显示那个援助索马里儿童的提示
7164

@@ -479,8 +472,8 @@ if has("gui_running")
479472
endif
480473

481474
" theme主题
482-
colorscheme solarized
483475
set background=dark
476+
colorscheme solarized
484477
set t_Co=256
485478

486479
"colorscheme molokai

vimrc.bundles

+10-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
"################### 包依赖 #####################
77
"package dependence: ctags
88
"python dependence: pep8, pyflake
9+
"
10+
"非兼容vi模式。去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限
11+
set nocompatible
12+
" configure Vundle
13+
filetype off " required! turn off
14+
set rtp+=~/.vim/bundle/vundle/
15+
call vundle#rc()
16+
917

1018
"################### 插件管理 ###################
1119

@@ -91,11 +99,11 @@ Bundle 'Lokaltog/vim-easymotion'
9199

92100
Bundle 'vim-scripts/matchit.zip'
93101

94-
" 显示marks
102+
" 显示marks 还有bug
95103
" m[a-zA-Z] add mark
96104
" '[a-zA-Z] go to mark
97105
" m<Space> del all marks
98-
Bundle "kshenoy/vim-signature"
106+
" Bundle "kshenoy/vim-signature"
99107

100108

101109
"################### 快速选中 ###################

0 commit comments

Comments
 (0)