-
-
Save mehdi89/2337bb58755bf2e1ea6a1bd6e43b67a3 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
sudo sed -i 's/auth required pam_shells.so/auth sufficient pam_shells.so/' /etc/pam.d/chsh | |
sudo apt install curl wget git zsh -y | |
sudo chsh -s $(which zsh) | |
#install ohmyzsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
/usr/bin/zsh | |
git clone https://github.com/zsh-users/zsh-autosuggestions.git /home/ubuntu/.oh-my-zsh/custom/plugins/zsh-autosuggestions | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /home/ubuntu/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting | |
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc | |
source ~/.zshrc |
chatGPT version
Q: One line command to install zsh, ohmyzsh, zsh-autosuggestions and zsh-systax-highligting.
Here is a one-line command that you can use to install zsh, oh-my-zsh, zsh-autosuggestions, and zsh-syntax-highlighting on Ubuntu:
sudo apt-get update && sudo apt-get install zsh git wget -y && sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
This command does the following:
- Updates the package list and installs zsh, git, and wget.
- Installs oh-my-zsh using the official installation script.
- Clones the zsh-autosuggestions and zsh-syntax-highlighting plugins into the oh-my-zsh custom plugins directory.
Once this command has completed, you should be able to use zsh as your default shell by running the following command:
chsh -s $(which zsh)
You will need to log out and log back in for the changes to take effect.
Keep in mind that this command installs the latest versions of these tools as of the knowledge cutoff of this model (2021). If you are running a newer version of Ubuntu, the command may need to be modified to install the correct package versions.
sh -c "$(curl -fsSL https://gist.githubusercontent.com/mehdi89/2337bb58755bf2e1ea6a1bd6e43b67a3/raw/554a79de0d36e5a0995d324380f2646133055a12/pro_zsh.sh)"