Motivation
Setting up a new Mac terminal can be a daunting task, especially when trying to recall previous configurations. This guide serves as a comprehensive reference for my personal setup, potentially benefiting others in the process.
Prerequisites
- Homebrew installed
Post-installation for Homebrew
After installing Homebrew, remember to execute the two steps in ‘Next steps’ as provided in the installation instructions.
Setting up iTerm2
- Install with command:
brew install --cask iterm2
- Launch iTerm2 and go to Settings
- Appearance
- Theme: Minimal
- Panes: 3
- Dimming: 1 and 3
- Profiles
- General: Reuse previous session’s directory
- Colors: Choose your preferred Color Preset
- Appearance
Setting up oh-my-zsh
To manage plugins and themes related to Zsh, it is recommended to get a framework for managing these (sort of similar to Homebrew makes it easy to install, manage and update applications).
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 via curl:
Plugins
Install the following plugins:
- zsh-autosuggestions
- zsh-completions
- fast-syntax-highlighting
First, clone the repositories into $ZSH_CUSTOM/plugins
(by default ~/.oh-my-zsh/custom/plugins
):
Then add the plugins to the ~/.zshrc
file:
For zsh-completions, add the following to the ~/.zshrc
file:
Note
For more information on zsh-completions installation, refer to this GitHub issue.
Installing Starship
Starship is a cross-shell prompt that works with Zsh.
- Install with command:
brew install starship
- Add the following to your
~/.zshrc
file:eval "$(starship init zsh)"
Here’s how your final ~/.zshrc
file should look:
Note
Remember, you can customize this file further by adding your own aliases, functions, or environment variables after the Starship initialization. Also, if you have any specific Oh My Zsh settings you want to modify (like updating strategy, completion waiting dots, etc.), you can add those near the top of the file, before sourcing Oh My Zsh.
Differences between Starship and oh-my-zsh
- oh-my-zsh is a comprehensive Zsh framework, while Starship is primarily a prompt customization tool.
- Starship works across different shells, not just Zsh.
- Starship uses a simple TOML file for configuration, making it easier to set up and customize.
- Starship is generally considered faster than oh-my-zsh ‘s default prompts, though it may be slower than some highly optimized Zsh prompts like Powerlevel10k.
Additional terminal tools
Consider installing additional terminal tools to enhance your workflow. For example, nnn
is a terminal file manager. Refer to my previous post for more detailed information on terminal tools for macOS.