Skip to content

Instantly share code, notes, and snippets.

@haoxiangsnr
Last active May 17, 2024 03:11
Show Gist options
  • Select an option

  • Save haoxiangsnr/6018461f8e59746413ba43f766d6874e to your computer and use it in GitHub Desktop.

Select an option

Save haoxiangsnr/6018461f8e59746413ba43f766d6874e to your computer and use it in GitHub Desktop.
cfg
# rm -rf ~/.oh-my-zsh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete
git config --global user.name "haoxiangsnr"
git config --global user.email "[email protected]"
git clone --bare https://[email protected]/haoxiangsnr/cfg.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup/.ssh
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
fi;
config checkout
config config status.showUntrackedFiles no
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment