Created
August 12, 2021 02:00
-
-
Save mzr1996/09b575cea8740331d1290f33a01e2113 to your computer and use it in GitHub Desktop.
配置新环境
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option() { | |
doc=$1 | |
command=$2 | |
echo "$doc ($command)" | |
while true; do | |
read -p "y(es)|n(o)|q(uit) " yn | |
case $yn in | |
[Yy]* ) eval $command; break;; | |
[Nn]* ) break;; | |
[Qq]* ) exit;; | |
* ) echo "请输入[y|n|q]";; | |
esac | |
done | |
echo | |
} | |
option "下载安装oh-my-zsh?" "sh -c \"\$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"" | |
repo="git@github.com:mzr1996/dotfiles.git" | |
option "下载个人仓库?" "git clone --bare $repo $HOME/.mydot && alias mydot='git --git-dir=$HOME/.mydot/ --work-tree=$HOME' && mydot config --local status.showUntrackedFiles no" | |
option "链接nvim配置文件?" "mkdir -p $HOME/.config/nvim && ln -s $HOME/.vimrc $HOME/.config/nvim/init.vim" | |
option "链接coc配置文件?" "mkdir -p $HOME/.config/nvim && ln -s $HOME/.sharedots/vim/coc-settings.json $HOME/.config/nvim/coc-settings.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment