Skip to content

Instantly share code, notes, and snippets.

@mehdi89
Last active December 20, 2022 09:52
Show Gist options
  • Save mehdi89/2337bb58755bf2e1ea6a1bd6e43b67a3 to your computer and use it in GitHub Desktop.
Save mehdi89/2337bb58755bf2e1ea6a1bd6e43b67a3 to your computer and use it in GitHub Desktop.
Pro ZSH
#!/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
@mehdi89
Copy link
Author

mehdi89 commented May 13, 2022

@mehdi89
Copy link
Author

mehdi89 commented Dec 20, 2022

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:

  1. Updates the package list and installs zsh, git, and wget.
  2. Installs oh-my-zsh using the official installation script.
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment