avatarRajdeep Singh

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

7596

Abstract

change the user login shell.</p><div id="fa52"><pre> chsh</pre></div><p id="b6a0">You can run the chsh command with any argument; in the end, the chsh command shows the available shells, and in the end, the chsh command asks you to enter the path of the available shell you enter the zsh path in prompts.</p><div id="13ce"><pre>rajdeepsingh@officialrajdeepsingh:~ chsh Password: Changing the login shell <span class="hljs-keyword">for</span> rajdeepsingh Enter the new value, or press ENTER <span class="hljs-keyword">for</span> the default Login Shell [/bin/bash]: /bin/zsh rajdeepsingh@officialrajdeepsingh:~</pre></div><p id="4b35">After changing the default shell, reboot your system.</p><div id="0713"><pre>sudo reboot now</pre></div><h1 id="b71d">How to install the oh my zsh framework?</h1><p id="3341">The oh my zsh is a framework based on the zsh shell. It comes with many built-inbuilt plugins and themes. Some plugins are preinstalled in the oh my zsh framework.</p><p id="2dba">You can easily install, remove and config the plugins and theme in the oh my zsh framework.</p><p id="4381">You can install the Oh my zsh framework in one command.</p><div id="0af7"><pre><span class="hljs-comment"># Curl</span> sh -c <span class="hljs-string">"<span class="hljs-subst">(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)</span>"</span>

<span class="hljs-comment"># Wget</span> sh -c <span class="hljs-string">"<span class="hljs-subst">(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)</span>"</span></pre></div><p id="49f2">I choose the <code>curl</code> command for installation. The command looks like this.</p><div id="1182"><pre>officialrajdeepsingh% sh -c <span class="hljs-string">"<span class="hljs-subst">(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)</span>"</span>

Cloning Oh My Zsh... remote: Enumerating objects: 1340, <span class="hljs-keyword">done</span>. remote: Counting objects: 100% (1340/1340), <span class="hljs-keyword">done</span>. remote: Compressing objects: 100% (1291/1291), <span class="hljs-keyword">done</span>. remote: Total 1340 (delta 28), reused 1138 (delta 25), pack-reused 0 Receiving objects: 100% (1340/1340), 1.99 MiB | 738.00 KiB/s, <span class="hljs-keyword">done</span>. Resolving deltas: 100% (28/28), <span class="hljs-keyword">done</span>. From https://github.com/ohmyzsh/ohmyzsh

  • [new branch] master -> origin/master branch <span class="hljs-string">'master'</span> <span class="hljs-built_in">set</span> up to track <span class="hljs-string">'origin/master'</span>. Already on <span class="hljs-string">'master'</span> /home/rajdeepsingh

Looking <span class="hljs-keyword">for</span> an existing zsh config... Found /home/rajdeepsingh/.zshrc. Backing up to /home/rajdeepsingh/.zshrc.pre-oh-my-zsh Using the Oh My Zsh template file and adding it to /home/rajdeepsingh/.zshrc.

     __                                     __   

____ / /_ ____ ___ __ __ ____ / /
/ __ / __ \ / __ `
/ / / / /
/ / __/ __ \ / // / / / / / / / / / / /
/ / / /(__ ) / / / _// // // // //_, / //// //
/
_/ ....is now installed!

Before you scream Oh My Zsh! look over the .zshrc file to <span class="hljs-keyword">select</span> plugins, themes, and options.

• Follow us on Twitter: @ohmyzsh • Join our Discord community: Discord server • Get stickers, t-shirts, coffee mugs and more: Planet Argon Shop</pre></div><p id="dca4">If you face an error: failed to connect to raw.githubusercontent.com port 443</p><div id="7fb4"><pre>officialrajdeepsingh% sh -c <span class="hljs-string">"<span class="hljs-subst">$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)</span>"</span>

curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 129372 ms: Couldn<span class="hljs-string">'t connect to server officialrajdeepsingh% ping raw.githubusercontent.com</span></pre></div><h2 id="e314">How to solve the error?</h2><p id="ee96">First, open the <code>/etc/hosts</code> file with any text editor like Vim, Nano, VS Code, etc.</p><div id="51b0"><pre>sudo nano /etc/hosts</pre></div><p id="da32">After opening, you paste the following code into the<code>/etc/hosts</code> file.</p><div id="67df"><pre><span class="hljs-comment"># raw.githubusercontent.com</span> 185.199.108.133 raw.githubusercontent.com</pre></div><p id="3c28">After pasting the code, look like this.</p><figure id="a5da"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*n77PVloUiFVLRypW_F4FNg.png"><figcaption>Oh my zsh framework</figcaption></figure><p id="a894">Your error is gone, and now you can easily install the oh my zsh framework in your system.</p><h2 id="8277">How to install the spaceship-prompt theme in the oh my zsh framework?</h2><p id="dcfc">The <a href="https://spaceship-prompt.sh/">spaceship-prompt theme</a> is a minimalistic, powerful, and extremely customizable Zsh prompt.</p><h2 id="86cf">Prerequisites</h2><ol><li><a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH">Zsh(v5.2 or recent)</a> must be installed.</li><li><a href="https://github.com/powerline/fonts">Power line Font</a> or <a href="https://github.com/ryanoasis/nerd-fonts">Nerd Font (even better)</a> must be installed. To check if the Font works for you, To test the font, run the following command:</li></ol><div id="7185"><pre><span class="hljs-meta prompt_"> </span><span class="language-bash"><span class="hljs-built_in">echo</span> -e <span class="hljs-string">"\xee\x82\xa0"</span></span></pre></div><p id="0481">Command Output looks like.</p><figure id="aa5c"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*WoVyPvTepgoqeESbZzDaYQ.png"><figcaption>Check whether the font is working or not</figcaption></figure><p id="b1d3">Everything is fine if the command successfully returns the GitHub branch icon.</p><p id="8508">Otherwise, install one of <a href="https://github.com/powerline/fonts">Power line Font</a> or <a href="https://github.com/ryanoasis/nerd-fonts">Nerd Font</a> in your system and check the font preference configuration in your terminal.</p><p id="2999"><b>Steps</b></p><ol><li><a href="#e864">Installation of the spaceship-prompt</a></li><li><a href="#dfe5">Link spaceship-prompt theme with on my zsh framework</a></li><li><a href="#cbcf">Change your default theme with a spaceship-prompt theme</a></li><li><a href="#7a73">Install Additional plugin</a></li></ol><h2 id="e864">Installation of the spaceship-prompt</h2><p id="e796">To install the <a href="https://spaceship-prompt.sh/">spaceship-prompt theme</a> with oh my zsh framework, then run the following command.</p><div id="00f8"><pre>git <span class="hljs-built_in">clone</span> https://github.com/spaceship-prompt/spaceship-prompt.git <span class="hljs-string">"<span class="hljs-variable">ZSH_CUSTOM</span>/themes/spaceship-prompt"</span> --depth=1</pre></div><p id="ac60">Command output looks like this.</p><div id="79b0"><pre>➜ ~ git <span class="hljs-built_in">clone</span> https://github.com/spaceship-prompt/spaceship-prompt.git <span class="hljs-string">"<span class="hljs-variable">$ZSH_CUSTOM</span>/themes/spaceship-prompt"</span> --depth=1

Cloning into <span class="hljs-string">'/home/rajdeepsingh/.oh-my-zsh/custom/themes/spaceship-prompt'</span>... remote: Enumerating objects: 402, <span class="hljs-keyword">done</span>. remote: Counting objects: 100% (402/40

Options

2), <span class="hljs-keyword">done</span>. remote: Compressing objects: 100% (307/307), <span class="hljs-keyword">done</span>. remote: Total 402 (delta 119), reused 191 (delta 82), pack-reused 0 Receiving objects: 100% (402/402), 2.34 MiB | 596.00 KiB/s, <span class="hljs-keyword">done</span>. Resolving deltas: 100% (119/119), <span class="hljs-keyword">done</span>.</pre></div><h2 id="dfe5">Link spaceship-prompt theme with on my zsh framework</h2><p id="c193">After downloading complete, Link the spaceship prompt with the Oh My Zsh framework.</p><div id="633c"><pre><span class="hljs-built_in">ln</span> -s <span class="hljs-string">"<span class="hljs-variable">ZSH_CUSTOM</span>/themes/spaceship-prompt/spaceship.zsh-theme"</span> <span class="hljs-string">"<span class="hljs-variable">ZSH_CUSTOM</span>/themes/spaceship.zsh-theme"</span></pre></div><h2 id="cbcf">Change your default theme with a spaceship-prompt theme</h2><p id="eca9">The last setup is to change or config the spaceship prompt theme with your in your <code>.zshrc</code> file.</p><div id="cd31"><pre><span class="hljs-comment"># .zshrc</span>

<span class="hljs-attr">ZSH_THEME</span>=<span class="hljs-string">"spaceship"</span></pre></div><p id="0c34">You can choose any text editor like Nano, vim, VS Code, etc. I use the Nano text editor.</p><div id="b20a"><pre> nano .zshrc</pre></div><p id="20be">Your <code>.zshrc</code> file looks like this.</p><figure id="49a0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*k53q3u0TM-xJ9AHE-iDH3w.png"><figcaption>Change the default theme in the oh my zsh framework</figcaption></figure><h2 id="7a73">Install Additional plugin</h2><p id="1992">You need to install an additional plugin in your system to enhance the working experience with the oh my zsh framework.</p><p id="9b0d">There are a bunch of plugins available for zsh. <a href="https://github.com/unixorn/awesome-zsh-plugins">Check out the available plugin list</a>.</p><p id="ce5d"><b>Popular plugin</b></p><ol><li><a href="#52a9">zsh autosuggestions</a></li><li><a href="#81ec">Zsh syntax highlighting</a></li></ol><h2 id="52a9">zsh autosuggestions</h2><p id="1660">The zsh autosuggestions plugin gives you command suggestions when you start typing commands based on history.</p><p id="8c1c">You can install the zsh-autosuggestions plugin with the following command.</p><div id="aa3f"><pre>git <span class="hljs-built_in">clone</span> https://github.com/zsh-users/zsh-autosuggestions <span class="hljs-variable">{ZSH_CUSTOM:-/.oh-my-zsh/custom}</span>/plugins/zsh-autosuggestions</pre></div><p id="d5c0">The command output looks like this.</p><div id="526e"><pre>rajdeepsingh <span class="hljs-keyword">in</span> ~ … ➜ git <span class="hljs-built_in">clone</span> https://github.com/zsh-users/zsh-autosuggestions <span class="hljs-variable">{ZSH_CUSTOM:-~/.oh-my-zsh/custom}</span>/plugins/zsh-autosuggestions Cloning into <span class="hljs-string">'/home/rajdeepsingh/.oh-my-zsh/custom/plugins/zsh-autosuggestions'</span>... remote: Enumerating objects: 2460, <span class="hljs-keyword">done</span>. remote: Counting objects: 100% (75/75), <span class="hljs-keyword">done</span>. remote: Compressing objects: 100% (52/52), <span class="hljs-keyword">done</span>. remote: Total 2460 (delta 36), reused 50 (delta 21), pack-reused 2385 Receiving objects: 100% (2460/2460), 571.83 KiB | 99.00 KiB/s, <span class="hljs-keyword">done</span>. Resolving deltas: 100% (1567/1567), <span class="hljs-keyword">done</span></pre></div><h2 id="81ec">Zsh syntax highlighting</h2><p id="2870">The ssh-syntax-highlighting plugin high light the command syntax for the shell zsh. Your terminal look like more colour full.</p><p id="9d24">You can install the zsh-syntax-highlighting plugin with the following command.</p><div id="3cfd"><pre>git <span class="hljs-built_in">clone</span> https://github.com/zsh-users/zsh-syntax-highlighting.git <span class="hljs-variable">{ZSH_CUSTOM:-/.oh-my-zsh/custom}</span>/plugins/zsh-syntax-highlighting</pre></div><p id="9669">Command output in the terminal looks like this.</p><div id="d379"><pre>➜ ~ git <span class="hljs-built_in">clone</span> https://github.com/zsh-users/zsh-syntax-highlighting.git <span class="hljs-variable">${ZSH_CUSTOM:-~/.oh-my-zsh/custom}</span>/plugins/zsh-syntax-highlighting Cloning into <span class="hljs-string">'/home/rajdeepsingh/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting'</span>... remote: Enumerating objects: 7041, <span class="hljs-keyword">done</span>. remote: Counting objects: 100% (128/128), <span class="hljs-keyword">done</span>. remote: Compressing objects: 100% (71/71), <span class="hljs-keyword">done</span>. remote: Total 7041 (delta 63), reused 84 (delta 51), pack-reused 6913 Receiving objects: 100% (7041/7041), 1.52 MiB | 362.00 KiB/s, <span class="hljs-keyword">done</span>. Resolving deltas: 100% (4738/4738), <span class="hljs-keyword">done</span>.</pre></div><h1 id="e3a3">How do I uninstall Oh my zsh and spaceship-prompt theme?</h1><p id="bdfd">To remove the<b> spaceship-prompt theme</b>, you must delete the <code>.oh-my-zsh/custom/themes</code> folder in your system.</p><div id="34c3"><pre>sudo <span class="hljs-built_in">rm</span> -R .oh-my-zsh/custom/themes</pre></div><p id="a565">To remove everything related to <b>the oh my zsh framework</b>, you need to remove the <code>.oh-my-zsh</code> folder in your system.</p><div id="c034"><pre>sudo <span class="hljs-built_in">rm</span> -R .oh-my-zsh</pre></div><h1 id="4568">FAQ</h1><h2 id="9f32">Why can you not install the Oh my zsh framework and spaceship-prompt theme with the plugin manager?</h2><p id="b046">You install the Oh My Zsh framework and spaceship-prompt theme with the zsh plugin manager, and bunches of plugin managers are available on the internet. For example, antigen, antibody, antidote, etc.</p><p id="7be4">Every plugin manager comes with its advantages and disadvantages. But zsh has tons of plugin managers, which creates confusion about which is best in stability and permanence, etc.</p><p id="26fe">To avoid confusion and problems, I installed the Oh My Zsh framework and spaceship-prompt theme without any zsh plugin manager. I never face any issues when I install the zsh plugin theme without any problem.</p><p id="1b0f">Going without a plugin manager is an excellent choice if you install a few plugins. If you install multiple plugins in your system, use the plugin manager.</p><h1 id="97e1">Conclusion</h1><p id="496f">Zsh and oh my zsh framework is a great productive tool for Linux developers or those who work with the command line.</p><p id="b620">Suppose you use zsh shell without the use of oh my zsh framework. Then zsh is not for you.</p><p id="7501">If you feel the power of zsh and oh my zsh framework. Then install both software. It is to give you the best user experience in your terminal.</p><p id="fd18">You can share and follow me on <a href="https://twitter.com/Official_R_deep">Twitter</a> and <a href="https://www.linkedin.com/in/officalrajdeepsingh/">LinkedIn</a>. I write tons of articles related to frontend development and Linux.</p><p id="bb74">If you are interested in those topics, follow me on <a href="https://officialrajdeepsingh.medium.com/">Medium</a>, <a href="https://officialrajdeepsingh.dev/">officialrajdeepsingh.dev</a>, join <a href="https://medium.com/thelinux">the Linux</a> and <a href="https://medium.com/frontendweb">frontend web</a> publication, and sign up for my <a href="https://officialrajdeepsingh.medium.com/subscribe">free newsletter</a>.</p></article></body>

Install z shell and config oh my zsh framework and spaceship prompt theme.

Debian

How do you install and set up the zsh shell, my zsh framework, and spaceship prompt theme in Debian?

Latest installation guide (2023) for z shell and configure oh my zsh framework and spaceship prompt theme.

Shell is a command-line interpreter; it provides a command-line user interface for every operating system.

The shell script is a file that contains human-readable text (commands), and text is known as a command.

You can run multiple shell commands with one file and automate the tasks in your system. Like, install x software or update x software in your operating system.

There are many shell command line interpreters like bash, C shell, Emacs, etc. The bash is the most common interpreter.

Check out the full list of available command line interpreters.

Context

· What is Z shell? · How do we check zsh install or not in my system? · How to install Z shell? · Check The Default Shell · Change The Default Shell · How to install the oh my zsh framework?How to solve the error?How to install the spaceship-prompt theme in the oh my zsh framework?PrerequisitesInstallation of the spaceship-prompt Link spaceship-prompt theme with on my zsh frameworkChange your default theme with a spaceship-prompt themeInstall Additional pluginzsh autosuggestionsZsh syntax highlighting · How do I uninstall Oh my zsh and spaceship-prompt theme? · FAQWhy can you not install the Oh My Zsh framework and spaceship-prompt theme with the plugin manager? · Conclusion

What is Z shell?

The z shell (zsh shell) is an enhanced version of the Bourne shell, and it gives you more freedom features as compared to bash. For example, You can change the theme, add or remove plugins, Prompts, Custom hooks, etc.

Check out the Z shell feature lists.

How do we check zsh installed or not in my system?

You can check whether or not the zsh shell is already installed on your computer. You can check with the following command.

$ zsh --version

It does not install in your system if it shows an error message in your terminal. Otherwise, it returns the version that is already installed in your system.

rajdeepsingh@officialrajdeepsingh:~$ zsh --version
Command 'zsh' not found, but can be installed with:
sudo apt install zsh

How to install Z shell?

The process of zsh shell(z shell) installation is straightforward, You need to copy the following command and paste it into your terminal.

sudo apt install zsh

The sudo command asks you for the root password; enter the password, and your zsh installation start.

rajdeepsingh@officialrajdeepsingh:~$ sudo apt install zsh
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libpcre3 zsh-common
Suggested packages:
  zsh-doc
The following NEW packages will be installed:
  libpcre3 zsh zsh-common
0 upgraded, 3 newly installed, 0 to remove and 11 not upgraded.
Need to get 5,231 kB of archives.
After this operation, 19.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu lunar/main amd64 libpcre3 amd64 2:8.39-15 [250 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu lunar/main amd64 zsh-common all 5.9-4 [4,171 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu lunar/main amd64 zsh amd64 5.9-4 [809 kB]                                                                          
Fetched 5,231 kB in 8s (625 kB/s)                                                                                                                            
Selecting previously unselected package libpcre3:amd64.
(Reading database ... 240437 files and directories currently installed.)
Preparing to unpack .../libpcre3_2%3a8.39-15_amd64.deb ...
Unpacking libpcre3:amd64 (2:8.39-15) ...
Selecting previously unselected package zsh-common.
Preparing to unpack .../zsh-common_5.9-4_all.deb ...
Unpacking zsh-common (5.9-4) ...
Selecting previously unselected package zsh.
Preparing to unpack .../archives/zsh_5.9-4_amd64.deb ...
Unpacking zsh (5.9-4) ...
Setting up zsh-common (5.9-4) ...
Setting up libpcre3:amd64 (2:8.39-15) ...
Setting up zsh (5.9-4) ...
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for debianutils (5.7-0.4) ...
Processing triggers for libc-bin (2.37-0ubuntu2) ...

After the installation process is done, to verify whether the zsh is installed or not, then run the following command in your terminal.

rajdeepsingh@officialrajdeepsingh:~$ zsh --version
zsh 5.9 (x86_64-ubuntu-linux-gnu)

For the first time, you run the zsh command in your terminal, you see a long message by the zsh command. The error should occur because the zsh command can not find .zshrc, .zshenv, .zprofile and .zloginfiles.

To solve this issue, type 0 and hit enter and the error should be gone.

ZSH configuration

Check The Default Shell

If you want to check which shell you use by default in your system. Most of the time, bash is the default shell interpreter in the Linux world.

echo $SHELL

The following command tells you what is your default shell.

rajdeepsingh@officialrajdeepsingh:~$ echo $SHELL
bash

Change The Default Shell

You can easily change the default shell in your system with achsh command. Chsh (change login shell) command is used to change the user login shell.

$ chsh

You can run the chsh command with any argument; in the end, the chsh command shows the available shells, and in the end, the chsh command asks you to enter the path of the available shell you enter the zsh path in prompts.

rajdeepsingh@officialrajdeepsingh:~$ chsh
Password: 
Changing the login shell for rajdeepsingh
Enter the new value, or press ENTER for the default
 Login Shell [/bin/bash]: /bin/zsh
rajdeepsingh@officialrajdeepsingh:~$

After changing the default shell, reboot your system.

sudo reboot now

How to install the oh my zsh framework?

The oh my zsh is a framework based on the zsh shell. It comes with many built-inbuilt plugins and themes. Some plugins are preinstalled in the oh my zsh framework.

You can easily install, remove and config the plugins and theme in the oh my zsh framework.

You can install the Oh my zsh framework in one command.

# Curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

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

I choose the curl command for installation. The command looks like this.

officialrajdeepsingh% sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Cloning Oh My Zsh...
remote: Enumerating objects: 1340, done.
remote: Counting objects: 100% (1340/1340), done.
remote: Compressing objects: 100% (1291/1291), done.
remote: Total 1340 (delta 28), reused 1138 (delta 25), pack-reused 0
Receiving objects: 100% (1340/1340), 1.99 MiB | 738.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
From https://github.com/ohmyzsh/ohmyzsh
 * [new branch]      master     -> origin/master
branch 'master' set up to track 'origin/master'.
Already on 'master'
/home/rajdeepsingh

Looking for an existing zsh config...
Found /home/rajdeepsingh/.zshrc. Backing up to /home/rajdeepsingh/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to /home/rajdeepsingh/.zshrc.

         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       ....is now installed!

Before you scream Oh My Zsh! look over the `.zshrc` file to select plugins, themes, and options.

• Follow us on Twitter: @ohmyzsh
• Join our Discord community: Discord server
• Get stickers, t-shirts, coffee mugs and more: Planet Argon Shop

If you face an error: failed to connect to raw.githubusercontent.com port 443

officialrajdeepsingh% sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 129372 ms: Couldn't connect to server
officialrajdeepsingh% ping raw.githubusercontent.com

How to solve the error?

First, open the /etc/hosts file with any text editor like Vim, Nano, VS Code, etc.

sudo nano /etc/hosts

After opening, you paste the following code into the/etc/hosts file.

# raw.githubusercontent.com
185.199.108.133 raw.githubusercontent.com

After pasting the code, look like this.

Oh my zsh framework

Your error is gone, and now you can easily install the oh my zsh framework in your system.

How to install the spaceship-prompt theme in the oh my zsh framework?

The spaceship-prompt theme is a minimalistic, powerful, and extremely customizable Zsh prompt.

Prerequisites

  1. Zsh(v5.2 or recent) must be installed.
  2. Power line Font or Nerd Font (even better) must be installed. To check if the Font works for you, To test the font, run the following command:
$ echo -e "\xee\x82\xa0"

Command Output looks like.

Check whether the font is working or not

Everything is fine if the command successfully returns the GitHub branch icon.

Otherwise, install one of Power line Font or Nerd Font in your system and check the font preference configuration in your terminal.

Steps

  1. Installation of the spaceship-prompt
  2. Link spaceship-prompt theme with on my zsh framework
  3. Change your default theme with a spaceship-prompt theme
  4. Install Additional plugin

Installation of the spaceship-prompt

To install the spaceship-prompt theme with oh my zsh framework, then run the following command.

git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1

Command output looks like this.

➜  ~ git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1

Cloning into '/home/rajdeepsingh/.oh-my-zsh/custom/themes/spaceship-prompt'...
remote: Enumerating objects: 402, done.
remote: Counting objects: 100% (402/402), done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 402 (delta 119), reused 191 (delta 82), pack-reused 0
Receiving objects: 100% (402/402), 2.34 MiB | 596.00 KiB/s, done.
Resolving deltas: 100% (119/119), done.

Link spaceship-prompt theme with on my zsh framework

After downloading complete, Link the spaceship prompt with the Oh My Zsh framework.

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

Change your default theme with a spaceship-prompt theme

The last setup is to change or config the spaceship prompt theme with your in your .zshrc file.

# .zshrc

ZSH_THEME="spaceship"

You can choose any text editor like Nano, vim, VS Code, etc. I use the Nano text editor.

$ nano .zshrc

Your .zshrc file looks like this.

Change the default theme in the oh my zsh framework

Install Additional plugin

You need to install an additional plugin in your system to enhance the working experience with the oh my zsh framework.

There are a bunch of plugins available for zsh. Check out the available plugin list.

Popular plugin

  1. zsh autosuggestions
  2. Zsh syntax highlighting

zsh autosuggestions

The zsh autosuggestions plugin gives you command suggestions when you start typing commands based on history.

You can install the zsh-autosuggestions plugin with the following command.

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

The command output looks like this.

rajdeepsingh in ~ …
➜ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Cloning into '/home/rajdeepsingh/.oh-my-zsh/custom/plugins/zsh-autosuggestions'...
remote: Enumerating objects: 2460, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 2460 (delta 36), reused 50 (delta 21), pack-reused 2385
Receiving objects: 100% (2460/2460), 571.83 KiB | 99.00 KiB/s, done.
Resolving deltas: 100% (1567/1567), done

Zsh syntax highlighting

The ssh-syntax-highlighting plugin high light the command syntax for the shell zsh. Your terminal look like more colour full.

You can install the zsh-syntax-highlighting plugin with the following command.

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Command output in the terminal looks like this.

➜  ~ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Cloning into '/home/rajdeepsingh/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting'...
remote: Enumerating objects: 7041, done.
remote: Counting objects: 100% (128/128), done.
remote: Compressing objects: 100% (71/71), done.
remote: Total 7041 (delta 63), reused 84 (delta 51), pack-reused 6913
Receiving objects: 100% (7041/7041), 1.52 MiB | 362.00 KiB/s, done.
Resolving deltas: 100% (4738/4738), done.

How do I uninstall Oh my zsh and spaceship-prompt theme?

To remove the spaceship-prompt theme, you must delete the .oh-my-zsh/custom/themes folder in your system.

sudo rm -R .oh-my-zsh/custom/themes

To remove everything related to the oh my zsh framework, you need to remove the .oh-my-zsh folder in your system.

sudo rm -R .oh-my-zsh

FAQ

Why can you not install the Oh my zsh framework and spaceship-prompt theme with the plugin manager?

You install the Oh My Zsh framework and spaceship-prompt theme with the zsh plugin manager, and bunches of plugin managers are available on the internet. For example, antigen, antibody, antidote, etc.

Every plugin manager comes with its advantages and disadvantages. But zsh has tons of plugin managers, which creates confusion about which is best in stability and permanence, etc.

To avoid confusion and problems, I installed the Oh My Zsh framework and spaceship-prompt theme without any zsh plugin manager. I never face any issues when I install the zsh plugin theme without any problem.

Going without a plugin manager is an excellent choice if you install a few plugins. If you install multiple plugins in your system, use the plugin manager.

Conclusion

Zsh and oh my zsh framework is a great productive tool for Linux developers or those who work with the command line.

Suppose you use zsh shell without the use of oh my zsh framework. Then zsh is not for you.

If you feel the power of zsh and oh my zsh framework. Then install both software. It is to give you the best user experience in your terminal.

You can share and follow me on Twitter and LinkedIn. I write tons of articles related to frontend development and Linux.

If you are interested in those topics, follow me on Medium, officialrajdeepsingh.dev, join the Linux and frontend web publication, and sign up for my free newsletter.

Zsh Shell
Zshell
Oh My Zsh
Spaceship Prompt Theme
Debian
Recommended from ReadMedium