Iterm Brew



Install Brew Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system. Now, open iTerm and install brew using following command. ITerm (brew cask install iterm) Google Chrome (brew cask install google-chrome) Slack (brew cask install slack) Zeplin (brew cask install zeplin).

Run - brew cask reinstall - to resinstall the cask.' Slack) brewinstall slack;; Docker) brewinstall docker;; iTerm) brewinstall iterm2;; Google Chrome) brewinstall google-chrome;; IntelliJ Idea) brewinstall intellij-idea;; Sourcetree) brewinstall sourcetree.

As a software engineer, we spend significant amount of time in terminal. Terminal in Mac OSX is better than windows but not as good as iTerm2. If you combine iTerm with Zsh and Oh-My-Zsh then what you get is awesomeness.

Install iTerm2

Download a stable build from https://www.iterm2.com/downloads.html and install it.

Install Brew

Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system.

Now, open iTerm and install brew using following command:

Install and Configure Fira Code Font

Fira Code is an extension of the Fira Mono font containing a set of ligatures for common programming multi-character combinations. This is just a font rendering feature: underlying code remains ASCII-compatible. This helps to read and understand code faster.

Without Fira Code

With Fira Code and Ligature

To install Fira Code, run following command:

ProTip: Fira Code font is supported in multiple editors and terminals. Checkout complete list on Fira Code site

Setup Font in iTerm

Step 1. Open Preferences in iTerm by pressing and , keys

Step 2. Go to Profile tab and create a new profile

Step 3. Go to Text tab. Change font and ASCII font to Fira Code and enable use of ligature

Install Zsh

Once you have brew installed, you can install zsh using following command:

Install and Configure Oh-My-Zsh

Oh-My-Zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes and much more.

Install Oh-My-Zsh using following command:

Set Theme

There are whole lot of themes to choose from here. My personal customized theme is based on bira theme.Change ZSH_THEME=robbyrussell to ZSH_THEME=YOUR_FAV_THEME_NAME into ~/.zshrc file. After change reload shell by:

Enable plugins

There’s an abundance of plugin in Oh-my-zsh. You can find list of plugins here.Most of the plugins provide autocompletion for command options on press of ⇥ tab key (demo). You can turn on plugins by updating plugins section in ~/.zshrc file like following:

Install zsh syntax highlighting and auto suggestions plugins if you are interested in these functionality.

Add following lines to end of the ~/.zshrc file. You can pick and choose from last 3 lines, based on the plugin you have installed.

ProTip: To reload any change made in ~/.zshrc file, use source ~/.zshrc command.

Working with Alias

Brew

Alias is not exclusive functionality of zsh but Oh-my-zsh provides lots of alias by default. Lots of plugins also come with alias for example git plugin.

If you want to create your on aliases, create a separate file and load that file using ~/.zshrc by adding following line in the file:

To list all the avaliable alias use command alias in the terminal.

HotKeys

If your hotkeys for moving backward (⌥ option + ) and forward (⌥ option + ) word by word do not work in iTerm then change keys preset in your profile to Natural Text Editing.

Setting Mac Terminal environment for Development

Unix shell and Framework installation

Between iTerm and Hyper, iTerm is preferred here. Download and install iTerm

Instead of using the Mac default Bash shell, preferred here is zsh with multiple plugin support.

  • Install latest version of zsh using brew and verify the version.
  • Make zsh as system’s default shell
  • Verify:
  • Install oh-my-zsh using this link
Iterm brewster

Install Powerline 10k

Run either

OR

Edit ~/.zshrc and set ZSH_THEME=”powerlevel10k/powerlevel10k”.

Install plugins

Global settings:`/etc/profile/etc/bashrc`

Personal settings:`~/.bash_profile OR ~/.bash_login OR ~/.profile~/.bashrc~/.bash_aliases`

.bash_profile -> login shell.bashrc -> non-login shell.

When you start a sub-shell (by typing a shell’s name at the command-prompt), you get a “non-login shell”.

When a “login shell” starts up, it reads the file“/etc/profile” andthen “~/.bash_profile” or “~/.bash_login” or “~/.profile”(whichever one exists - it only reads one of these, checking for them in the order mentioned).

When a “non-login shell” starts up, it reads the file “/etc/bashrc” and then the file “~/.bashrc”.

#Semlink the files to be consistent with further editsAssuming the project is cloned in $HOME/Programming folder on a new mac

The following commands will symlink the files and be modified for later use on other macs

  • $PATH variable, a list directory names separated by colon (:) characters
  • The superuser has /sbinand /usr/sbin entries for easily executing system administration commands.

#OS X: Change your PATH environment variable

Setting Temporary Environmental Variables in OS X

export PATH=$PATH:~/bin

Adding a Temporary Location

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Adding in a Permanent Location

Brew Iterm 3

create a .bash_profile or .profile file in the home directory and set the path in the files as.sh export PATH='/usr/local/<my_package>/bin:$PATH'

Iterm Brew

References