Zsh
Last updated
Was this helpful?
Last updated
Was this helpful?
So that means - no need to manually install Zsh anymore! 🥳
Install zsh and zsh-completions using Homebrew:
Upon completing installation, you'll come across this message:
What we'll need to do is to add fpath=(path/to/zsh-completions/src $fpath)
to our .zshrc file. However, it will still get overwritten when we install Oh-My-Zsh (Which I'll explain later, so let's go back to this in the next step)
Now let's use a framework built on top of this shell called Oh My Zsh!
Let's open .zshrc file using Sublime Text
Then copy paste this text, and save the file:
And go back to the terminal and run this:
You can further extend zsh's power and functionalities by adding plugins to Oh My Zsh. There are useful plugins like completion plugins that will let zsh
know which arguments the package has so it can autocomplete. We can do so by adding this to our .zshrc file
What is a .zshrc file? Basically, it's a Z-shell resource that contains all your configurations.
Your .zshrc file is usually located at the root. To open, use your default text editor:
To add a plugin we need to search and add these strings of text to our current plugins list in the .zshrc file. Example:
One thing we need to do is tell the system to use programs installed by Homebrew (in /usr/local/bin
) rather than the OS default if it exists. We do this by adding/usr/local/bin
to your$PATH
environment variable.
Now that we've already installed Oh My Zsh! This command will append the text PATH="/usr/local/bin:$PATH"
on the .zshrc file
Open iTerm, go to Preferences > Profiles and create your own color scheme!
Go to Preferences > Profiles and click on the "+" button to add a new profile.
Give it a name, and click on the Colors tab
Import cobalt2.itermcolors by clicking on the Color Presets.. > Import..
After importing, select Color Presets.. > cobalt2
Open & edit your .zshrc file with $ open .zshrc
then search & modify the following line $ ZSH_THEME="cobalt2"
Powerline uses Pip (Which is a package manager for Python) Unfortunately,
Install Powerline
Now head back to iTerm and go to Preferences > Profiles > Text and change the font family to Inconsolata for Powerline, font weight to Medium, and set the font size to 12px. Then you should be seeing icons in your command prompt like this:
Then refresh zsh by typing source ~/.zshrc
or by restarting your terminal
ctrl + a
to move at the beginning of the line
ctrl + e
to move at the end of the line
ctrl + u
to clear the current line
ctrl + k
to clear all the characters that precedes the cursor position
ctrl + l
to clear the screen
It's not working! Did you carefully follow the instructions? Also try restarting your terminal for it to take effect.
Install on top of zsh to get additional functionality and supercharge your terminal!
You can also manually select things you want to add from .
My personal favorite is the . To use it:
Download
While there are you can use with Oh My Zsh, my favorite is the . You can click on the theme link and follow the instructions there or follow through here:
Copy & paste the file to ~/.oh-my-zsh/themes/
directory
What is ? It's a statusline plugin for vim, and provides statuslines and prompts. And along with it are that is responsible for the icons you have on your terminal. To enable powerline fonts on the theme we're using:
Clone the and run install.sh
to install all powerline fonts
There's these weird [?] symbols on my terminal. Probably missing the
Where are my zsh settings stored? .zshrc
file located in your home directory. It’s a hidden file, so you might not see it in your home directory, but you can view it by running open ~/.zshrc
from the terminal. Swap out open
with your favorite editor command, such as nano
, subl
or vim
. (these are text editors, nano
for , subl
for , and vim
for )
I have no idea how to use the terminal / So hard to follow the instructions! I suggest taking by Wesbos.
When I open my terminal this message shows up:compdef: unknown command or service: rails
Just run this and it should be working fine: