Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install OH-MY-ZSH in Ubuntu 20.04 - DesignLinux

Oct 27 2020
designlinux 0 Comments

When working with Unix-based environments our majority of time will be spent on working in a terminal. A good looking terminal will make us feel good and improves our productivity. This is where OH-MY-ZSH comes into play.

OH-MY-ZSH is an open-source framework for managing ZSH configuration and is community-driven. It comes bundled with tons of helpful functions, plugins, helpers, themes, and a few things that will make you better at the terminal. There are currently 275+ plugins and 150 themes supported.

First thing first, you need to install and set up ZSH as your default shell in Ubuntu.

Requirements

  • Zsh should be installed (v4.3.9 or more recent would do but we prefer 5.0.8 and newer).
  • Curl or Wget should be installed.
  • Git should be installed (v2.4.11 or higher recommended).

Let’s jump in and see how to install and set up the OH-MY-ZSH program in Ubuntu Linux.

Installing OH-MY-ZSH in Ubuntu Linux

Installation of Oh My Zsh can be carried out using “Curl” or “Wget” commands in your terminal. Make sure either of one utility is installed in the OS, if not install them along with git by running the following apt command.

$ sudo apt install curl wget git

Next, install Oh My Zsh via the command-line with either curl or wget as shown.

$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
OR
$ sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
Installation of Oh-My-Zsh in Ubuntu
Installation of Oh-My-Zsh in Ubuntu

Once you Install OH-MY-ZSH, it will take a backup of your existing .zhrc file. Then a new .zshrc file will be created with configurations. So whenever you decide to remove OH-MY-ZSH using the uninstaller, an automatically old .zshrc file will be reverted.

-rw-r--r--  1 tecmint tecmint  3538 Oct 27 02:40 .zshrc

All the configurations are placed under .zshrc file. This is where you will either change the parameters or enable new plugins or change themes based upon the needs.

Let’s break down some of the important parameters we can modify in the .zshrc file.

OH-MY-ZSH Themes

Among all features in OH-MY-ZSH, I love the set of themes that comes in a bundle with the installation. It visually improves my terminal look and feel. Themes are installed under “/home/tecmint/.oh-my-zsh/themes/“.

$ ls /home/tecmint/.oh-my-zsh/themes/
oh-my-zsh themes
oh-my-zsh themes

By default “robbyrussell” is the theme that gets loaded. To change the theme modify the parameter “ZSH_THEME=<THEME-NAME>” under the .zshrc file.

$ nano ~/.zshrc
Change Oh-My-Zsh Theme
Change Oh-My-Zsh Theme

You have to source (source ~/.zshrc) the file for changes to be effective.

$ source ~/.zshrc

OH-MY-ZSH Plugins

There are tons of plugins that are supported by OH-MY-ZSH. Setting up a plugin is quite easy. All you have to do is get the plugin package and add the plugin name in the plugins parameter on the .zshrc file. By default, git is the only plugin that is enabled after installation.

Add Oh-My-Zsh Plugins
Add Oh-My-Zsh Plugins

Now I will add two more plugins “ZSH-autosuggestions and ZSH-Syntax-highlighting” by cloning the packages.

$ git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

To make plugins effective all you have to do is edit the .zhsrc file, add the plugin name in plugins=() with a space between each plugin name.

$ nano ~/.zshrc
Add New Plugins to Oh My ZSH
Add New Plugins to Oh My ZSH

Now source (source ~/.zshrc) file for changes to be effective. Now you can see from the screenshot the auto-suggestion feature is enabled and it remembers the command I used previously and suggests based on it.

Autocomplete
Autocomplete

OH-MY-ZSH Automatic Update

OH-MY-ZSH automatically checks for updates bi-weekly. To disable it, set parameter DISABLE_AUTO_UPDATE=”true”. You can also control the number of days the update should run by setting export UPDATE_ZSH_DAYS=<NUMBER OF DAYS>.

Auto Update Oh-My-Zsh
Auto Update Oh-My-Zsh

It is possible to run manual updates by running the command.

$ omz update
Update Oh-My-Zsh
Update Oh-My-Zsh

Removing OH-MY-ZSH in Ubuntu Linux

If you want to remove oh-my-zsh, run the command “uninstall oh_my_zsh“. It will remove all the necessary files and folders part of oh_my_zsh and revert to the previous state. Restart your terminal for changes to be effective.

$ uninstall oh_my_zsh
Remove Oh-My-Zsh in Ubuntu
Remove Oh-My-Zsh in Ubuntu

That’s it for this article. We have explored what is oh-my-zsh, how to install and configure it. We have also seen plugins and themes. There are a lot more features than what we discussed in this article. Explore and share your experience with us.

Related

Tags: Ubuntu Tips, Zsh Tips

Bash Sequence Expression (Range)

Prev Post

How to Install and Setup Zsh in Ubuntu 20.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 1
  • 649
  • 1,055,421

DesignLinux.com © All rights reserved

Go to mobile version