Basic ZSH Setup After New Linux Installation With Oh-My-ZSH
Setup ZSH right after installing linux to use like a pro by executing simple commands

Shezan loves technology who is currently studying Computer Science and Engineering. He codes frontend & backend of a website. He also does penetration testing on web apps.
What is ZSH?
The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.
Zsh was created by Paul Falstad in 1990 while he was a student at Princeton University. It combines features from both ksh and tcsh, offering functionality such as programmable command-line completion, extended file globbing, improved variable/array handling, and themeable prompts.
What is Oh-My-ZSH
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes and many more.
Difference between Oh-My-ZSH and ZSH?
Installing ZSH, you are essentially downloading a new program and telling your terminal to use that program (say, instead of bash) to process the commands and run scripts. oh-my-zsh provides a way of managing your zsh configurations, themes and plugins to extend the look and functionality of your shell.
Setup ZSH
Check your default shell.
echo $0This will output your default shell in the terminal and it most probably
bashon your computer.Download prerequisites for
zshshell.sudo apt install curl git wget -yNow download
zshshell.sudo apt install zsh -yCheck if
zshis installed in your computer or not.zshThis will change the style in your terminal.
Change Default Shell for your user account.
chsh -s $(which zsh)Now reboot your linux computer or you can logout and then login into the system also.
Now check shell again.
echo $0Now this should show
zsh. If it is showingbashagain then you may repeat the process carefully again.Download Oh-My-ZSH
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Download ZSH Auto Suggestion which is a ZSH plugin that suggests commands as you type based on history and completions.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestionsDownload another ZSH plugin ZSH Syntax Highlighting which provides syntax highlighting for the shell zsh.
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingAfter succesfully passing previous steps, its time to decorate your terminal. Open your
.zshrcfile with your favourite text editor (nanoin my case), probably~/.zshrcis the file on your computer.nano ~/.zshrcChange theme of your ZSH shell. Comment out previous themes line with a
#. and add your favourite theme. You may find all yourOh-My-ZSHpre-installed theme in your~/.oh-my-zsh/themesfolder.# default theme # ZSH_THEME="robbyrussell" ZSH_THEME="agnoster"Add your favouriote ZSH plugins (these are in
~/.oh-my-zsh/themes) for convenient usage:
Installfzfto usezsh-interactive-cd.plugins=( command-not-found copybuffer git history zsh-autosuggestions zsh-interactive-cd zsh-syntax-highlighting )If you have
bashaliases in~/.bash_aliasesfile then you have to add one more line in~/.zshrcfile# Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh"You have to add this before the line:
source $ZSH/oh-my-zsh.shRun the command to see changes:
exec zshIf you are seeing broken style in your terminal then you have to download and install a powerline font such as Fira Font, Hack Font etc.
(Optional) If you want to explore more style then you may try Power Level 10k Theme:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc(If you chose 18) Go to powerlevel10k folder & run this to customize style
p10k configureFurther know about powerlevel 10k on this link.






