
Hellodevelopers 🧑💻,thanks for reading my post 🙏.
A shell is a user interface foraccess to an operating system’s services. Most often the user interacts with the shell using a command-line interface (CLI). Theterminal 💻 is a program that opens a graphical window and lets youinteract with the shell.
As developers, one of theprograms we use most is our terminal, and as such it should allow us tobe as productive and fast as possible 🚀 as well as to show off its features and pretty look 😎.
So let's embark on a journey 🧭 to make ourterminal in macOS no less awesome 🙌.
iTerm2
Initially, we willreplace thepreinstalled terminal foriTerm2, which hastons of very useful features.
- Go toiTerm2 download page and downloaded the stable release.
- After the download is complete, drag the file to the Applications folder.
- Bonus: Place iTerm2 in a convenient place in the dock (replace the original terminal if you already have it there).
iTerm2has a standalone update mechanism so I prefer toinstall it manually rather than through a brew cask.
Oh My Zsh
Next, let'sunleash our terminal byinstallingOh My Zsh.
Oh My Zsh is an open source, community-driven framework for managing your Zsh configuration.
Oh My Zshcomes bundled withplugins that'll make your life as a developer easier and leave youfeeling like a superhero.
To enable a plugin add its name to the plugins array in your.zshrc
file (found in the$HOME
directory).
Here are some thatI highly recommend:
plugins=(alias-finder brew common-aliases copypath copyfile docker encode64 githistoryjsontools macos web-search z)
Wheninstalling Zsh'stheme andplugins, opt foroh-my-zsh installation (... which is actually a
git clone
of the plugin's repo into the$ZSH_CUSTOM
folder and a setting change in.zshrc
). It will play best with the other settings in.zshrc
, and theautoupdate plugin will keep themup-to-date.
Zsh Theme
My choice of theme for Zsh isPowerlevel10k. Beyond being fast and minimal, it hasmaintained its popularity for many years andcontinues to improve with each new version. Also, I'm totally in favor ofinstalling therecommended font that comes with it.
Zsh plugins
- autoupdate-zsh-plugin: Auto update git-repositories in $ZSH_CUSTOM folder. This pluginis crucial because itkeeps the rest of the pluginsup-to-date.
- zsh-syntax-highlighting: It enables highlighting of commands while they’re typed. This helps in reviewing commands before running them, particularly in catching syntax errors.
- zsh-autosuggestions: It suggests commands as you type based on your history and completions.
- zsh-history-substring-search: Type in any part of any command from your history, and then press chosen keys, such as the UP and DOWN arrows, to cycle through matches.
- zsh-nvm: Zsh plugin for installing, updating and loading nvm.nvm installation is relevant for developers working withnode.js. This plugin is recommended sincenvm via brew isn't supported.
iTerm2 Elevation
Toopen the preferences at any stage, Open iTerm2 → Press
(command) ⌘ + , (comma)
.
Shell Integration
Enabling the shell integration featureenables many useful features by itself.
Follow theofficial documentation instructions.
In practice the steps should look something like this:
Key Mappings
Setting thesekey mappings allows us touse common keyboard shortcuts in our terminal.
Follow theinstructions in the gist I made for this purpose, and if you found it helpful, I'd appreciate you giving it a star as well.
Hotkey
Setting ahotkey allows us toshow or hide iterm window even if another application is active.
- Preferences → Keys → Hotkey → ☑️ Show/hide all windows with a system-wide hotkey
- Click on the rectangle that appears right to "Hotkey:" → Set your preferred key sequence
Status Bar
Setting up thestatus bar allows us toget up-to-date information about the environment we're working in.
- Preferences → Profiles → Session → ☑️ Status bar enabled
- Click Configure Status Bar button to begin setting up your status bar configuration.My active components are: CPU Utilization, Memory Utilization and Network Throughput
Remove thelast login: ...
line on top of each new window
cd ~;touch .hushlogin
Allow iTerm to access administrative files
- System Preferences → Security & Privacy → Full Disk Access → ☑️ iTerm.app
Use TouchID for sudo execution
- Open
/etc/pam.d/sudo
with a text editor as admin
sudovim /etc/pam.d/sudo
- add
auth sufficient pam_tid.so
lineon top and save - Preferences → Advanced → Allow sessions to survive logging out and back → Select "No"
Set some "nice to have" preferences
- General → Closing → ☑️ Quit when all windows are closed
- General → Selection → ☑️ Double-click performs smart selection
- General → Window → ☑️ Smart window placement
- Appearance → General → Theme → Select "Minimal"
- Appearance → Tabs → ☑️ Show tab bar even when there is only one tab
- Profiles → General → Icon (Basics) → Select "Built-in Icon for Current App"
- Profiles → General → Working Directory → 🔘 Advanced Configuration → Edit... → Working Directory for New Split Panes → 🔘 Reuse previous session's directory
- Profiles → Text → Cursor → 🔘 Vertical bar + ☑️ Blinking cursor
- Profiles → Text → Font → Increase size (I use
16
as in my IDE) - Profiles → Terminal → Shell Integration → ☐ Show mark indicators
- Keys → Navigation Shortcuts → Shortcut to choose a split pane → Select your preferred option (I use
⌥ Number
) - Pointer → General → ☑️ Focus follows mouse
- Advanced → Mouse → Scroll wheel sends arrow keys when in alternate screen mode → Select "Yes"
Add a screensaver
- CMatrix shows text flying in and out in a terminal like as seen in "The Matrix" movie.
brewinstallcmatrixcmatrix
- pipes.sh shows animated pipes.
brewinstallpipes-shpipes-sh
Install useful command-line tools
agarrharr / awesome-cli-apps
🖥 📊 🕹 🛠 A curated list of command line apps
The Result ✨
configuration files (.zshrc, iterm-profile.json etc..) as a gist
Top comments(2)

- LocationKarnal, India
- EducationGuru Gobind Singh Indraprastha University
- WorkSoftware Engineer
- Joined
Great post!
Please consider updating plugins as I received this message after installation:The
copydirplugin is deprecated. Use the
copypathplugin instead.

Done. Thanks for catching that 🙏🏼.
For further actions, you may consider blocking this person and/orreporting abuse