deactivate YCM if it's not usable
This commit is contained in:
parent
93539024ca
commit
edd15f452a
1 changed files with 31 additions and 4 deletions
35
install.sh
35
install.sh
|
|
@ -8,6 +8,7 @@ main() {
|
|||
cd $DIR
|
||||
if [[ $1 == "--ycm" ]]; then
|
||||
rm .youcompletemesetup
|
||||
vim +BundleInstall +qall
|
||||
setup_youcompleteme
|
||||
exit 0
|
||||
else
|
||||
|
|
@ -40,6 +41,9 @@ install_everything() {
|
|||
|
||||
echo "setting up git files..."
|
||||
symlink_files git-files gitconfig
|
||||
|
||||
create_local_bin
|
||||
setup_local_symlinks
|
||||
}
|
||||
|
||||
setup_gitmodules() {
|
||||
|
|
@ -54,12 +58,12 @@ symlink_files() {
|
|||
|
||||
for filename in $filenames
|
||||
do
|
||||
if [ -f $home/.${filename} ] || [ -l $home/.$filename ]; then
|
||||
if [ -e $HOME/.${filename} ]; then
|
||||
echo "moving old .$filename to .${filename}.bak"
|
||||
mv $home/.$filename $home/.${filename}.bak
|
||||
mv $HOME/.$filename $HOME/.${filename}.bak
|
||||
fi
|
||||
echo "linking $dir/$source_dir/$filename $home/.$filename"
|
||||
ln -s "$dir/$source_dir/$filename" "$home/.$filename"
|
||||
echo "linking $DIR/$source_dir/$filename $HOME/.$filename"
|
||||
ln -s "$DIR/$source_dir/$filename" "$HOME/.$filename"
|
||||
done
|
||||
}
|
||||
|
||||
|
|
@ -76,4 +80,27 @@ setup_youcompleteme() {
|
|||
fi
|
||||
}
|
||||
|
||||
create_local_bin() {
|
||||
(cd ~/local) || mkdir ~/local
|
||||
(cd ~/local/bin) || mkdir ~/local/bin
|
||||
}
|
||||
|
||||
setup_local_symlinks() {
|
||||
setup_vim_symlink
|
||||
}
|
||||
|
||||
setup_vim_symlink() {
|
||||
vim_version=`vim --version | head -1 | cut -d " " -f 5`
|
||||
if [[ $(echo "$vim_version >= 7.4" | bc) = 1 ]]; then
|
||||
ln -s `which vim` ~/local/bin/vim
|
||||
else
|
||||
if [ -d $DIR/vim-files/vim/bundle/YouCompleteMe ]; then
|
||||
echo "Your version of vim is too old to use YCM -- removing the YCM bundle..."
|
||||
echo "rerun this installer with the --ycm option once vim is >= 7.4"
|
||||
echo "your new shellrc files will look for 'vim' in ~/local/bin, but this has not been setup for you."
|
||||
rm -rf $DIR/vim-files/vim/bundle/YouCompleteMe
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue