代码拉取完成,页面将自动刷新
同步操作将从 小弟调调/vim-web 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env bash
# Reset
Color_off='\033[0m' # Text Reset
# Regular Colors
Red='\033[0;31m' # Red
Blue='\033[0;34m' # Blue
Version='0.1.0'
echo 'Welcome to VimWeb, a powerful & modern vim distribution'
echo 'Booting VimWeb ...'
# 生成 .vim 文件夹
# [[ -d ~/.vim ]] || mkdir ~/.vim;
# tmp dir
# [[ -d ~/VimWeb ]] || mkdir ~/VimWeb;
# .vimrc
# cd ~/VimWeb;
# [[ -d ~/VimWeb/rc ]] || git clone https://github.com/jaywcjlove/vim-web.git;
install_vim () {
if [[ -d "$HOME/.vim" ]]; then
if [[ "$(readlink $HOME/.vim)" =~ \.VimWeb$ ]]; then
echo -e "${Blue}Installed VimWeb for vim${Color_off}"
else
mv "$HOME/.vim" "$HOME/.vim_back"
echo -e "${Blue}BackUp $HOME/.vim${Color_off}"
ln -s "$HOME/.VimWeb" "$HOME/.vim"
echo -e "${Blue}Installed VimWeb for vim${Color_off}"
fi
else
ln -s "$HOME/.VimWeb" "$HOME/.vim"
# ln -s "$HOME/.VimWeb/.vimrc" "$HOME/.vimrc"
echo -e "${Blue}Installed VimWeb for vim${Color_off}"
fi
if [[ -d "$HOME/.vimrc" ]]; then
if [[ "$(readlink $HOME/.vimrc)" =~ \.vimrc$ ]]; then
echo -e "${Blue}Installed .vimrc for vim${Color_off}"
else
mv "$HOME/.vimrc" "$HOME/.vimrc_back"
echo -e "${Blue}BackUp $HOME/.vimrc${Color_off}"
ln -s "$HOME/.VimWeb/.vimrc" "$HOME/.vimrc"
echo -e "${Blue}Installed .VimWeb/.vimrc for vim${Color_off}"
fi
else
ln -s "$HOME/.VimWeb/.vimrc" "$HOME/.vimrc"
echo -e "${Blue}Installed .VimWeb/.vimrc for vim${Color_off}"
fi
}
uninstall_vim () {
if [[ -d "$HOME/.vim" ]]; then
if [[ "$(readlink $HOME/.vim)" =~ \.VimWeb$ ]]; then
rm "$HOME/.vim"
echo -e "${Blue}Uninstall VimWeb for vim${Color_off}"
if [[ -d "$HOME/.vim_back" ]]; then
mv "$HOME/.vim_back" "$HOME/.vim"
echo -e "${Blue}Recover $HOME/.vim${Color_off}"
fi
fi
fi
if [[ -f "$HOME/.vimrc_back" ]]; then
mv "$HOME/.vimrc_back" "$HOME/.vimrc"
echo -e "${Blue}Recover $HOME/.vimrc${Color_off}"
fi
}
usage () {
echo " "
echo " VimWeb install script : ${Version}v0.1.0"
echo " "
echo -e " ${Blue}Install VimWeb for vim${Color_off}"
echo " curl -sLf https://raw.githubusercontent.com/jaywcjlove/vim-web/master/install | bash -s -- install"
echo " "
echo -e " ${Blue}Uninstall VimWeb${Color_off}"
echo " curl -sLf https://raw.githubusercontent.com/jaywcjlove/vim-web/master/install | bash -s -- uninstall"
echo " "
}
need_cmd () {
if ! hash "$1" &>/dev/null; then
echo -e "${Red}need '$1' (command not found)${Color_off}"
exit 1
fi
}
fetch_repo () {
if [[ -d "$HOME/.VimWeb" ]]; then
git --git-dir "$HOME/.VimWeb/.git" pull
echo -e "${Blue}Successfully update .VimWeb${Color_off}"
else
git clone https://github.com/jaywcjlove/vim-web.git "$HOME/.VimWeb" --depth=1 --recurse-submodules
echo -e "${Blue}Successfully clone .VimWeb${Color_off}"
fi
curl -LSso ~/.VimWeb/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo -e "${Blue}Successfully download ~/.VimWeb/autoload/pathogen.vim${Color_off}"
curl -LSso ~/.VimWeb/colors/molokai.vim https://raw.githubusercontent.com/fatih/molokai/master/colors/molokai.vim
echo -e "${Blue}Successfully download ~/.VimWeb/colors/molokai.vim${Color_off}"
}
if [ $# -gt 0 ]
then
case $1 in
uninstall)
uninstall_vim
exit 0
;;
install)
need_cmd 'git'
fetch_repo
install_vim
# echo -e "${Red}need '$1' (command 5 install_vim)${Color_off}"
exit 0
;;
-h)
usage
exit 0
;;
*)
usage
exit 0
esac
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。