Last active
February 19, 2021 21:55
-
-
Save leoheck/4136cd602fbece506caa43f3a2634434 to your computer and use it in GitHub Desktop.
Shell Customization
This file contains hidden or 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
sudo apt update | |
sudo apt install -y zsh | |
sudo apt install -y git | |
sudo apt install -y curl | |
sudo apt install -y wget | |
sudo apt install -y binutils | |
# Install oh-my-zsh | |
if [[ ! -d ~/.oh-my-zsh ]]; then | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
else | |
upgrade_oh_my_zsh | |
fi | |
# Install spaceship-theme | |
if [[ ! -d $ZSH_CUSTOM/themes/spaceship-prompt ]]; then | |
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1 | |
ln -sf "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" | |
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="spaceship"/g' ~/.zshrc | |
fi | |
# Force zsh as main shell | |
chsh -s $(which zsh) | |
# Create a script to fix ZSH history | |
read -r -d '' FIX_ZSH_HISTORY_SCRIPT <<-EOM | |
mv ~/.zsh_history ~/.zsh_history_bad | |
strings ~/.zsh_history_bad > ~/.zsh_history | |
fc -R ~/.zsh_history | |
rm ~/.zsh_history_bad | |
EOM | |
echo ${FIX_ZSH_HISTORY_SCRIPT} > ~/fix_zsh_history | |
chmod +x ~/fix_zsh_history |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment