Table of Contents
In this post we will see how can we install and setup up zsh shell and use oh-my-posh with it in wsl ubuntu.
Setup Z Shell
Install the Z shell and git
sudo apt install zsh
sudo apt install git
Check the Z shell version
zsh --version
Change the default shell
chsh -s $(which zsh)
Log out and login again to use the new default shell
Check the current shell
echo $SHELL // Expected result: /bin/zsh
Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install zsh-autosuggestions and zsh-syntax-highlighting
Set up zsh-syntax-highlighting
- Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
):
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Set up zsh-autosuggestions
- Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Plugins
Oh My Zsh comes with a shitload of plugins for you to take advantage of. You can take a look in the plugins directory and/or the wiki to see what's currently available.
Enabling Plugins
Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the .zshrc
file. You'll find the zshrc file in your $HOME
directory. Open it with your favorite text editor and you'll see a spot to list all the plugins you want to load.
vi ~/.zshrc
For example, this might begin to look like this:
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
Load the config
source ~/.zshrc
Related Posts
Setting up oh-my-posh and PSReadLine in PowerShell
In this post we will see how to setup the oh-my-posh and PSReadLine with PowerShell.
Set up Windows Terminal with PoshGit, oh-my-posh and Cascadia Code PL
In this post we will see how to setup windows terminal with PoshGit and oh-my-posh to make the terminal more productive