Original author(s) | Paul Falstad[1] |
---|---|
Developer(s) | Peter Stephenson, et al.[1] |
Initial release | 1990; 30 years ago |
Stable release | 5.8 / February 15, 2020; 6 months ago[2] |
Repository | |
Written in | C |
Operating system | Cross-platform |
Type | Unix shell |
License | MIT-like[3] |
Website | www.zsh.org |
- Aug 10, 2020 zsh-version. Upgrade it with: upgradeohmyzsh Customize your terminal's theme, fonts, colors, and more. To get the best out of zsh, you'll want to install some dependencies. Use a custom theme. Powerlevel10k is a popular theme for zsh. It emphasizes speed, flexibility, and out-of-the-box experience. Install Powerlevel10k for Oh My Zsh with.
- Mar 12, 2017 This video will go over the basics of oh-my-zsh installation. This video will go over the basics of oh-my-zsh installation. Mac OS Catalina Top New Features - Duration: 9:31. Tech Talk America.
So, in Terminal a new zsh will potentially run all configuration files. For simplicity’s sake, you should use just one file. The common choice is.zshrc. Most tools you can download to configure zsh, such as ‘prezto’ or ‘oh-my-zsh’, will override or re-configure your.zshrc. You could consider moving your code to.zlogin instead. Dec 29, 2018 Zsh, or z shell, is a popular shell alternative to bash and tcsh, complete with many improvements and customization options offered through the Oh-My-ZSH project. If you’d like to use zsh as the default shell in Terminal for Mac OS rather than bash, you can do so.
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.
History[edit]
Paul Falstad wrote the first version of Zsh in 1990[4] while a student at Princeton University.[5] The name zsh derives from the name of Yale professor Zhong Shao (then a teaching assistant at Princeton University) — Paul Falstad regarded Shao's login-id, 'zsh', as a good name for a shell.[6][7]
Zsh is available as a separate package for Microsoft Windows as part of the UnxUtils collection of nativeWin32ports of common GNU Unix-like utilities.[8]
In 2019, macOS Catalina adopted Zsh as the default login shell, replacing the aging GPLv2 licensed version of Bash,[9] and when Bash is run interactively on Catalina, a warning is shown by default.[10]
Features[edit]
Z shell's configuration utility for new users
Features include[11]:
- Programmable command-line completion that can help the user type both options and arguments for most used commands, with out-of-the-box support for several hundred commands
- Sharing of command history among all running shells
- Extended file globbing allows file specification without needing to run an external program such as find
- Improved variable/array handling
- Editing of multi-line commands in a single buffer
- Spelling correction and autofill of command names (and optionally arguments, assumed to be file names)
- Various compatibility modes, e.g. Zsh can pretend to be a Bourne shell when run as
/bin/sh
- Themeable prompts, including the ability to put prompt information on the right side of the screen and have it auto-hide when typing a long command
- Loadable modules, providing among other things: full TCP and Unix domain socket controls, an FTP client, and extended math functions.
- The built-in
where
command. Works like thewhich
command but shows all locations of the target command in the directories specified in$PATH
rather than only the one that will be used. - Named directories. This allows the user to set up shortcuts such as
~mydir
, which then behave the way~
and~user
do.
Oh My Zsh[edit]
Oh My Zsh logo
Zsh with Agnoster theme running on Konsole terminal emulator
![Zsh Zsh](https://www.rogoit.de/webdesign-typo3-blog-duisburg/wp-content/uploads/2016/04/oh-my-zsh-vi-mode-702x336.png)
A user community website known as 'Oh My Zsh' collects third-party plug-ins and themes for the Z shell.[12] As of 2019, their GitHub repository has over 1,350 contributors, over 250 plug-ins, and over 140 themes, of varying quality. It also comes with an auto-update tool that makes it easier to keep installed plug-ins and themes updated.[13][14]
See also[edit]
References[edit]
- ^ ab'The Z Shell Manual' (Version 5.0.0). Sourceforge.net. July 21, 2012. Retrieved September 18, 2012.
- ^'unposted: Release 5.8'. sourceforge.net. February 15, 2020. Retrieved February 17, 2019.
- ^'zsh / Code / [281031] /LICENCE'. Paul Falstad. Retrieved February 7, 2015.
- ^'zsh - a ksh/tcsh-like shell (part 1 of 8)'. alt.sources. December 14, 1990. Retrieved September 18, 2012.
- ^'Z-Shell Frequently-Asked Questions'. Sourceforge.net. February 15, 2010. Retrieved September 18, 2012.
- ^'The Z-Shell (ZSH) Lovers' Page'. Guckes.net. c. 2004. Retrieved October 2, 2012.
- ^'Zsh Mailing List Archive'. Zsh.org. August 8, 2005. Retrieved October 2, 2012.
- ^Native Win32 ports of some GNU utilities
- ^Warren, Tom (June 4, 2019). 'Apple replaces bash with zsh as the default shell in macOS Catalina'. The Verge. Retrieved June 13, 2019.
- ^'Use zsh as the default shell on your Mac - Apple Support'. Retrieved 1 July 2019.
- ^'Z-Shell Frequently-Asked Questions'. zsh.sourceforge.net. Retrieved 2020-03-04.
- ^'Oh My ZSH - Community driven framework with 150+ plugins and 100+ themes'. Retrieved May 7, 2014.
- ^'robbyrussell/oh-my-zsh'.
A delightful community-driven (with 1,000+ contributors) framework for managing your zsh configuration. Includes 200+ optional plugins (rails, git, OSX, hub, capistrano, brew, ant, php, python, etc), over 140 themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
- ^Russel, Robby. 'd'Oh My Zsh'. freeCodeCamp. Retrieved 18 August 2020.
External links[edit]
- zsh at Curlie
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Z_shell&oldid=973640798'
by rajaraodv
In this blog I’ll cover installing ITerm2, ZSH shell, “oh my ZSH”, Themes, ITerm2 color schemes, “oh my ZSH” plugins and enable “ligature” support to help create a beautiful and powerful Terminal.
If you want to just make your regular Bash Terminal powerful, take a look at my previous blog: “Jazz Up Your Bash Terminal”. But ZSH explained in this blog is more powerful stuff.
Summary:
We’ll be covering a lot of things. This may be confusing, so here is the summary of what we will be doing.
- Install ITerm2 — This is a better alternative to the default Terminal
- Install latest ZSH shell — This is more powerful than the regular bash shell. We will switch ITerm2 to use ZSH shell.
- Install “Oh My ZSH “— This is a CLI tool to easily configure ZSH and add themes and plugins to ZSH
- Add two types of Themes using “Oh My ZSH” — some themes need extra steps so we will cover both
- Install different ITerm2 Schemes — These are just color schemes for the UI
- Add two different Plugins using “Oh My ZSH” to improve productivity
- Enable “ligature” support so when you write an arrow =>;, it appears like a real arrow →
Step 1— Install ITerm2
A lot of programmers like ITerm2 instead of the default Terminal. It is similar to the Terminal, but has lots of features of its own. It of course can run ZSH, Bash, and other shells inside it.
The following video shows some of the new features of Item 2 (v3).
For this blog we’ll use ITerm2. When I mention “Terminal”, I mean ITerm2. Although the steps are the same for both Terminal or ITerm2.
Step 2— Change Shell To ZSH
The following video shows why ZSH is better than just a bash shell.
Option 1 — Use Mac’s own ZSH:
Mac comes with a ZSH out-of-the-box, so we don’t need to install it. However, sometimes it’s an older version of ZSH. Typically it’s located at /bin/zsh. To use it, all we need to do is to change shell (chsh).
- Open the Terminal (or ITerm2) and type the following command.
2. Enter the password and it will change the shell, upon logout and login.
3. Logout and re-login
4. To test, open the Terminal and type the following, and it should say zsh.
Option 2— Install Homebrew and Install latest ZSH via Homebrew
This option is pretty common among users, because some of the plugins only work with the latest ZSH.
Homebrew, simply said, is a command line installer for all sorts of software. Let’s install that first.
- Install Homebrew by running the following command.
2. If you get Command Line Tools for Xcode error, it means you haven’t installed the CLI tools for Xcode. If you don’t get the error, you can skip this step, because you already have it installed.
XCode Developer CLI tools are used by various apps that manipulate core OSX features. So make sure to install the Xcode CLI tools by running the following command.
$ xcode-select —-install
Note: The above command opens up Mac’s installer and installs the XCode Developer CLI tools. If it doesn’t work, try xcode-select -r
to reset.
3. Install ZSH via Homebrew
Run the following command to install ZSH. It gets installed at
/usr/local/bin/zsh
PS: Mac’s default ZSH is at /bin/zsh
4. Use the Homebrew version of ZSH
Run the following command. You will be prompted to enter Mac’s password.
5. Logout and log back in.
6. Test if we are using ZSH and the correct ZSH
Step 3— “Oh My ZSH”
“Oh My ZSH” is a plugin that runs on top of ZSH. Statview 5.0 software download. It provides default config for ZSH (~/.zhrc file) and also provides themes and more features.
From what I know, most power users who use ZSH also use “Oh My ZSH”.
- Install “Oh My ZSH”
Run the following command to install “oh My ZSH”.
2. Close and quit ITerm2 and reopen it.
It should look something like below. Notice that the prompt has changed and the theme is a bit different — That’s “Oh My ZSH” in action for you.
![Oh My Zsh For Mac Oh My Zsh For Mac](https://upload-images.jianshu.io/upload_images/99476-390dae07a4f1c017.png?imageMogr2/auto-orient/strip|imageView2/1/w/300/h/240)
Oh My Zsh Mac Install
Step 4— Change Themes And Install Fonts
In this step, we’ll add two different “Oh My ZSH” Themes. “Oh My ZSH” comes with tons of themes. Nintendo switch emulator for mac macbook pro. PS: But some Themes need extra steps like installing specific fonts and so on.
To set a Theme, simply open ~/.zshrc file (created by “Oh My ZSH”) and change the theme as shown below.
PS: .zshrc is the config file for ZSH shell. People who don’t use “Oh My ZSH” will have to manually create this file and add any configs themselves. “Oh My ZSH” automatically creates this file if it doesn’t exist and then adds its own set of configs into this file.
Theme 1 — Let’s add a Theme called “Avit”
- Open .zshrc
2. Change the Theme to “Avit”
You can browse all the “Oh My ZSH” Themes here. Telestream episode pro 6.5 for mac. To change the Theme, simply change the ZSH_THEME value in ~/.zshrc file from robbyrussell to Avit.
3. Update ZSH config Pdf raster to vector converter.
Run the following command to update the config.
4. Change the background color and font size
Open ITerm2 > Preferences > Profiles > Colors and change the background black color to use 20% gray as shown below. Lay file.
Then open Text > Change Font and change the size to 14pt.
OK, Let’s install a different Theme that needs fonts.
Theme 2 — Installing “agnoster” Oh My ZSH theme
This is a popular theme because it emulates the Powerline Python app that enhances the terminal. The following picture shows how it looks. But this theme also needs us to install Powerline themes.
1. Install Powerline fonts
2. Change the Theme to “agnoster”
3. Quit ITerm2 and reopen it.
4. Set Powerline font
You can set any Powerline patched font you like. All the fonts end with “for Powerline”.
Open
ITerm2 > Preferences > Profiles > Text > Change Font
and set it to something that has “for Powerline”. I’m choosing “Meslo LG DZ for Powerline” font.Note — If you are confused about the fonts and Themes: the Themes are for “Oh My ZSH” and ZSH shell and the fonts are for the Iterm2 itself.
5. All Done
At this point your Terminal should look like below:
Step 5 — Install iTerm2 “color schemes” (ITerm2 Themes)
There are plenty of gorgeous color schemes for iTerm2. These schemes change the foreground color, background color, cursor color, and so on. You can find them at iTerm2-color-schemes Github repo.
Note: These are just color schemes of the ITerm2 UI and don’t deal with the command prompt’s look and feel like “Oh My ZSH”’s themes (other than just changing colors).
Follow these steps to install them.
- Download the iTerm2-color-schemes as a zip file and extract it
- The “Schemes” folder contains all the color scheme files — they end with
.itermcolors
- Open
iTerm2 > Preferences > Profile > Colors > Color Presets > Import
- In the import window, navigate to the “Schemes” folder (from step 2)
- Select all the files so you can import all the color schemes at once
- Simply select whichever color scheme you like.
My favorites are Batman and Argonaut
The Argonaut color scheme looks like below:
Step 6— Install Plugins
Plugins add more functionalities to your workflow. By default “Oh My ZSH” already has the “git” plugin! and that’s why you were able to see all those Git statuses in the prompts in earlier screenshots. Let’s add another one to see how it works.
Note: In this section, we’ll install two different plugins to show how they work.
Plugin 1 — Add Syntax Highlighting Plugin
The Syntax Highlighting plugin adds beautiful colors to the commands you are typing as shown below.
- Clone the zsh-syntax-highlighting plugin’s repo and copy it to the “Oh My ZSH” plugins directory.
2. Activate the plugin in
~/.zshrc
by adding `zsh-syntax-highlighting
to the Plugins section as shown below.3. Re-read zshrc configuration
Plugin 2 — Add ZSH-AutoSuggestion Plugin
What Is Zsh Mac
This plugin auto suggests any of the previous commands. Pretty handy! To select the completion, simply press → key.
- Install the plugin
PS: ZSH_CUSTOM points to ~/.oh-my-zsh/custom
Step 7 — Use Ligature Support
There are various fonts that help make operators like less than, double equals, right arrow, not equals, and so on look beautiful. For example, every time you type: =>, it becomes: →.
To use this, we need fonts that support ligatures. We also need to enable it in ITerm2. FiraCode is one such font. Follow the steps to install and enable ligatures.
- Download the FiraCode repo and extract the zip file (or clone it)
- Open the
dstr > ttf
folder and double click on all the*.ttf
files and select the “Install font” button to install each of the font variations. - Navigate to
ITerm2 | Preferences | Profiles | Text
- Select
Use Ligatures
checkbox - Click on
Change Font
and selectFira Code Regular
font
Summary
We have covered a lot in this blog starting from installing latest ZSH via Homebrew, Oh My ZSH, Plugins, Themes, enable “ligatures” for FiraCode font.
?? Thank you!
If this was useful, please click the clap ? button down below a few times to show your support! ⬇⬇⬇ ??
My Other Posts
ECMAScript 2015+
Terminal Improvements
WWW
Virtual DOM
React Performance
Functional Programming
WebPack
- Webpack & Hot Module Replacement [HMR] (under-the-hood)
Draft.js
React And Redux :
- A Guide For Building A React Redux CRUD App (3-page app)
If this was useful, please click the clap ? button below a few times to show your support! ⬇⬇⬇ ??
Oh My Zsh Mac Theme
If you have questions, please feel free to ask me on Twitter: https://twitter.com/rajaraodv