Framework for WSL( Oh my zsh!)

Check out event 1 documentation, for installation guide for WSL.

Oh My Zsh!

NOTE:- One of the most popular alternative to oh my zsh! is fishshell, but the installation for fishshell is a bit complicated.

Why don’t you open your WSL. Well it looks like a plain old terminal right? Now we will help you customize it.
zsh short for zshell is a command line interpreter used by Linux or in this case your WSL.

What is Oh My Zsh!

Oh My Zsh helps you customize your zsh configuration/layout.
How? (you may ask).
By providing you with solutions like:

Advantages-

Installing “oh my zsh!”

Type the following in your terminal and hit enter to install oh my zsh!:

sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

(You can check you oh my zsh! Github to know more about themes.)

.zshrc

The configuration for oh my zsh! can be edited by editing the .zshrc by opening it any text editors like notepad, VSCode, sublime text, VIM etc.
The address of the file is ~/.zshrc. That is, it is present in ~ or /home/<your_username> directory.
You must keep in mind that when ever oh my zsh! starts it always runs .zshrc file.

Adding default start-up directory

Every-time you start your wsl you might observe that it opens in a specific directory always. In order to edit that you can tell oh my zsh! to open wsl every-time it in any other directory.
Since the .zshrc file is read every-time oh my zsh! starts, you can add the command in that file to change the directory so that it automatically opens wsl in that directory.
To do that add the following command

cd path/to/the/directory

to the .zshrc file( in any line)(recommended method). Or you can run the following command

echo "cd path/to/the/directory" >> ~/.zshrc

Adding a Theme

To add your theme, check out their Github page, select a theme and add it in your .zshrc file(at around line 11). Remove the default theme and add yours. It should look something like

ZSH_THEME=( "<theme_name_with_qoutes>" )

Adding plugins

You can check out the pre-installed plugins on the Github page of oh my zsh!. You can activate those by editing the .zshrc file and following the instructions from line 69 of the .zshrc file.
(You can add other plugins also but the instructions for those are not mentioned in this article.)
The line should look like

plugins=(git macos) //This is for the "git" and "macos" plugins. 

You can add as many plugins as you want. But remember, plugins make you efficient but too many plugins can slow down the terminal.

Disabling auto updates

You can disable auto updates for oh my zsh! by uncommenting the 27th line on the .zshrc file.
It should like

zstyle ':omz:update' mode disabled

To exit oh my zsh!

You can exit oh my zsh! and go back to the normal bash terminal window using the command bash and to enter oh my zsh! again you can enter exit in bash.

Credits: secuRIT Core :)

Edit this page