Last active
June 11, 2022 20:24
Star
You must be signed in to star a gist
Setting up zsh and Oh My Zsh on Ubuntu automatically with replaced theme and plugins
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
#!/bin/bash | |
# Remove existing configs and install zsh and Oh My Zsh | |
sudo rm -rf ~/.zsh* | |
sudo rm -r ~/.oh-my-zsh | |
sudo apt install -y curl zsh tmux | |
# You will need to exit Zsh shell after this command | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
echo $SHELL | |
# Copy default remplate | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template .zshrc | |
# Fetch plugin repositories | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
# Replace plugins and default theme | |
sed -i 's/^plugins.*/plugins=(git docker extract zsh-syntax-highlighting zsh-autosuggestions)/g' ~/.zshrc | |
sed -i "s/^ZSH_THEME.*/ZSH_THEME='obraun'/g" ~/.zshrc | |
# change default shell | |
sudo chsh --shell /bin/zsh $USER | |
# set tmux configuration | |
echo "setw -g mouse on\nset-option -g history-limit 20000" > ~/.tmux.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment