A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/profpan396/how-to-install-and-configure-zshell below:

amarpan/how-to-install-and-configure-zshell: How to install Z Shell, change themes, and enable the autosuggestions plug-in on the command line interface (CLI)

How to Install and Configure Z Shell in Linux

Written by Amar Panjwani
Technical Writer

Z Shell (zsh) is a popular alternative to the default command line bash shell with improved features like recursive path expansion, automatic spelling correction, and plug-in and theme support.

This guide will walk you through the process of installing and configuring zsh, including how to change themes and enable the time-saving autosuggestions plug-in.

Complete the following steps prior to getting started:

  1. Install Git:
sudo apt install curl wget git
  1. Install Zsh:
  1. Install Oh My Zsh:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

You should now see the following prompt asking if you'd like to change your defaut shell to zsh. Type y to confirm.

Take a look at your new command line and you should notice the difference right away.

If for any reason you need to switch back to the bash shell, use the following command:

Proceed to log out and back into your session for the change to take effect.

Run echo $SHELL to confirm the output is /bin/bash

By default, the zsh theme is set to robbyrussell, the name of the founder of Oh My Zsh. However, this is rather plain and there are over 100+ included themes with a wider assortment of colors and styles to choose from.

For example, here are 3 uniquely different themes to choose from:

  1. jonathan

  1. xiong-chiamiov

  1. agnoster

Follow these steps to change themes to jonathan:

  1. Open your zsh configuration file:
  1. Press i to enter Insert Mode.

  2. Change the ending of the line reading:

to

  1. Press ESC to leave Insert Mode and enter Command Mode.

  2. Type :wq + ENTER to save and quit.

  3. Reload the command line:

  1. Check out your newly themed command line and repeat steps 1-6 with a few more themes to find the best fit.

  2. To see the full list of locally available zsh themes, follow these steps:

    a. Change directories to the zsh themes folder:

    b. List the names of all the available themes:

The autosuggestions plug-in is quite possibly the single most time-saving tool when coding. Instead of having to type the same command over and over again in full, this plug-in automatically suggests the rest of your command as you are typing, without even having to press TAB.

For example, instead of having to type git push origin main every single time you wish to push a new commit, you can instead type git push and the command line will automatically show a preview of the rest of the suggested command based on your shell's history.

Follow these steps to install and enable the autosuggestions plug-in:

  1. Change directories to the oh-my-zsh plug-ins location:
  1. Clone the autosuggestions plugin packages:
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
  1. Edit the zsh configuration file:

    a. Type vi ~/.zshrc

    b. Press i to enter Insert Mode.

    c. Update the line beginning with plugins=(git) to plugins=(git zsh-autosuggestions)

    d. Press ESC to leave Insert Mode and enter Command Mode.

    d. Type :wq + ENTER to save and quit.

  2. Reload the command line for the changes to take effect:

  1. Try it out! Start typing a command you know to be in your shell's history and watch as zsh offers autosuggestions. After seeing a suggestion that you'd like to approve, press the Right Arrow key to accept it.

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4