Super fast OSX Terminal with zsh and oh-my-zsh. Time to be a Linux hero. Time for practice. Lots of practice. I intend for this post to save you slow zsh Mac OSX Terminal users many hours of time and suffering. I wonder if oh-my-zsh is going to fix this slow OSX Terminal with oh-my-zsh with some sort of theme standardization and theme warning. Oh-My-Zsh is a framework for Zsh, the Z shell. Oh-my-Zsh configuration turned out to be not so straight-forward with instructions being scattered all over, so I decided to gather it all in one place. Browse other questions tagged macos terminal zsh oh-my-zsh or ask your own question. The Overflow Blog Podcast 261: Leveling up with Personal Development Nerds. MacのOSをCatalinaに変更した際、デフォルトのShellをZshに変更しました。 このタイミングでOh My Zshで設定を変更したのでブログに残しておきます。.
If you are using Mac as development machine,
Terminal.app
must be one of the most used apps. Terminal might be not fancy to begin with, but you can totally make it more elegant and fancy if you follow with me.We will be doing these for our Terminal
- Install Terminal Profile: Customize Terminal Color
- Install
oh-my-zsh
: Use powerfulzsh
for Terminal, instead ofshell
- Install
oh-my-zsh
themes: Beautifyoh-my-zsh
- Instal
oh-my-zsh
must-have plugins: Get more advanced and convenient features for Terminal
Preparation
Mac miller nikes on my feet mp3 download. Recommend to install
homebrew
first:Install zsh if you are on macOS version prior to Catalina:
Install Terminal Profile
- Go to osx-terminal-theme and download your favorite theme in
scheme
folder - Double click the theme file to install and set as default
Feel free to use my Terminal Profile if you would like to try: https://gist.github.com/tonyxu-io/6b845cb1a53622eb4f1ce4063365e427
Install 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 a few things that make you shout…
Install
oh-my-zsh
:Install oh-my-zsh theme
Built-in themes
oh-my-zsh
provides some built-in themes which you can immediately use:- Find your favorite theme in built-in themes list: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
- Set
ZSH_THEME
to your favorite theme name in~/.zshrc
- Activate setting by
source ~/.zshrc
Third-party themes
There are more third-party themes developped for
oh-my-zsh
, find and install them here:Install oh-my-zsh must-have plugins
oh-my-zsh
has many powerful plugins, below are some must-have plugins that will boost your productivity.Sample config:
git
Built-in,use abbreviations for git commands, e.g.
gaa
->git add --all
, use alias | grep git
to get all abbreviations commandsActivate: Add to
~/.zshrc
plugins sectionextract
Built-in, no need to use complicated
tar
to extract zip filesActivate: Add to
~/.zshrc
plugins sectionautojump
Use
j
to quickly jump to a folder, e.g. j Downloads
->cd ~/Downloads
Install:
brew install autojump
Follow instructions and add below line in
~/.zshrc
:zsh-syntax-highlighting
Commands syntax highlight plugin
Install:
brew install zsh-syntax-highlighting
Add
zsh-syntax-highlighting
to ~/.zshtc
plugins sectionOther install guides: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md
zsh-autosuggestions
Auto complete commands by typing → Omerta english patch.
Install:
brew install zsh-autosuggestions
Follow instructions and add below line in
~/.zshrc
:My own ~/.zshrc config
The era of .NET developers being constrained on using only Windows as a platform is gone. (At least for ASP.NET). That might be very cool to some, but also scary for others. Fear of change is true. Nevertheless, it's definitely time (if not yet) to get out of the comfort zone and get your feet wet. Being able to work with .NET on Linux/Mac is one of the points that makes me agree 100% with Nick Craver that .NET Core is the future.
After reading Scott Hanselman's blog post last week, I decided to setup WSL on my laptop. If you don't know what Windows Subsystem for Linux is (WSL from now on in this post), I recommend reading this before.
The TL;DR of that link is:
WSL lets developers run Linux environments -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a virtual machine.
While setting it up on my machine was very easy, I didn't want to stay with the boring Windows bash shell. Guys at work use Mac's with oh-my-zsh and boy that made me pretty jealous. It was not that straightforward to make it all work though. So hopefully, this post will help me and others in the future. Here's what we are going to do:
- Enable WSL on Windows 10
- Install zsh + oh-my-zsh
- Configure zsh and oh-my-zsh
- Change Themes and colors
- Adding Bash on Ubuntu task in ConEmu*
Enable WSL on Windows 10
This is pretty straightforward to set up, Just follow the instructions here to get Ubuntu running. After you are in, update the packages, by running:
sudo apt-get update
. When all is working, you can continue to the next step.Installing zsh
Open the Ubuntu app installed from the App Store. We will now install zsh:
After installing it, type
zsh
. zsh will ask you to choose some configuration. We will do this later on while installing oh-my-zsh
, so choose option 0
to create the config file and prevent this message to show again.Installing oh-my-zsh
Before all we need to have
git
installed:Then, use
curl
to install oh-my-zsh:This will clone the repo and replace the existing
~/.zshrc
with a template from oh-my-zsh
.Configuring zsh/oh-my-zsh
First, we need to make sure
zsh
is executed by default for Bash on Ubuntu. This is not mandatory, but if not done you need to type zsh
every time. For this, edit the .bashrc
file with nano: nano ~/.bashrc
and paste this right after the first comments:Save it
Ctrl + shift X
and restart your Ubuntu shell. You should be on zsh by default now.Changing the Theme of oh-my-zsh
oh-my-zsh has several nice Themes. It's worth checking them out. Delphi ds150e software 2013. For this tutorial, I'm going to use the awesome agnoster.
Edit the
~/.zshrc
again with nano: nano ~/.zshrc
:Save it and restart your Ubuntu shell again.
Now was the tricky part while I was doing this on my laptop. After installing the theme, I got a totally broken shell (as shown in the image), with weird fonts and missing icons. That was expected due to missing Powerline Fonts, but even after installing them on Ubuntu the Theme was still broken. I tried several things and couldn't make it work. Since we will run it with ConEmu, I didn't want to spend more time on it. The Ubuntu shell is very limited anyway so. not a big deal.
Oh My Zsh For Mac Pro
Installing missing Powerline Fonts
We need to install the Powerline fonts in our Windows to make the agnoster theme work. Follow these steps:
- Clone the powerline repository on Windows
- Open an admin PowerShell, navigate to the root of the repo and run this:
This will install all the fonts on your Windows. You might get an error from PowerShell blocking you from running the script. Check this out if it happens with you. Make sure to reverse the policy after.
Changing directory colors
The directory colors for zsh is awful. If you followed along, by now you should have an ugly yellow or dark blue background on folders when
ls/ll
. Luckily, we can change that by installing a Solarized Color Theme from here. Follow these steps:- Pick a theme from the GitHub repo (I'm using dircolors.ansi-dark since I use a dark shell).
- Download the file making sure to put it in the user's home:
- Edit your
~/.zshrc
and paste this:
We have nice colors now :)
Setting Bash on Ubuntu task in ConEmu
Open ConEmu, and go to
Settings
. Navigate on the left-menu: Startup > Tasks
. There, click at the +
button at the bottom.- Add a name for the task. Anything will suffice. I used
bash::ubuntu
to group Ubuntu into the bash tasks. - On
Task parameters
choose an icon for the task. I picked the Ubuntu icon app that is buried under some very long path. but any .ico will work. You can leave it blank if you don't care. - For the
command
use this%windir%system32bash.exe ~ -cur_console:p
. This will start bash under the user home directory. Since we already configuredzsh
to run by default, this is enough.
Open the new task on ConEmu and.. Voalá!
Oh My Zsh Mac Brew
Nice command look, lots of git shortcuts and much more productivity. Couldn't enjoy this more.
Oh My Zsh Macports
Additional links
Here are a few other things you might want to look:
- oh-my-zsh cheatsheet: Lots of commands to improve your productivity
- Colors page on ConEmu: How to change ConEmu color scheme (If you liked mine, I'm using Solarized (Luke Maciak) with Meslo LG M DZ for Powerline console font)
- Understand why you're not supposed to touch Linux files using Windows apps: https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
Would be cool to see what other things you use on your setup. Just let me know in the comments!