Andy from Webcrunch

Subscribe for email updates:

Portrait of Andy Leverenz
Andy Leverenz

October 7, 2024

Last updated October 8, 2024

How to make your Mac Terminal Beautiful

Are you tired of staring at a bland terminal while you code? Combine iTerm2, custom ANSI themes, and Oh My Zsh with the Spaceship prompt to transform your terminal into a visually appealing and efficient workspace. Follow this detailed tutorial to set up a beautiful terminal on your Mac.

Step 1: Install iTerm2

iTerm2 is a powerful and versatile terminal emulator for macOS. It offers advanced features like split panes, hotkeys, and custom color schemes.

  1. Download iTerm2: Visit the iTerm2 website and click on the download link for the latest version.
  2. Install iTerm2: Once the download is complete, open the downloaded file and drag the iTerm2 application into your Applications folder.

Step 2: Install Oh My Zsh

Oh, My Zsh is a delightful, open-source, community-driven framework for managing your Zsh configuration. It has many plugins and themes, making it a versatile choice for any terminal enthusiast.

  1. Install Zsh: If you don’t already have Zsh installed, open your terminal and run:
brew install zsh

This command uses Homebrew, a popular package manager for macOS, to install Zsh.

  1. Set Zsh as Default Shell: After installing Zsh, you might want to set it as your default shell. Run:
chsh -s /bin/zsh

You may need to restart your terminal or log out and back in for the changes to take effect.

  1. Install Oh My Zsh: Run the following command in your terminal to install Oh My Zsh:
sh -c "$(curl -fsSL <https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh>)"

This command downloads and runs an installation script from the Oh My Zsh repository on GitHub.

Step 3: Customize with Spaceship Prompt

Spaceship is a minimalistic, powerful, and highly customizable Zsh prompt. It provides a visually appealing and information-rich prompt for your terminal.

  1. Install Spaceship Prompt: Open your terminal and run:
npm install -g spaceship-prompt

Ensure you have Node.js and npm (Node Package Manager) installed before running this command.

  1. Configure Spaceship Prompt:
    • Open your .zshrc file in a text editor:
nano ~/.zshrc

Add the following line to configure Spaceship as your prompt:

ZSH_THEME="spaceship"

Save and close the file, then apply the changes:

source ~/.zshrc

The Spaceship prompt should now be active in your terminal.

Step 4: Apply Custom ANSI Themes

Enhance your terminal's appearance further with custom ANSI color schemes. These themes can significantly improve its readability and aesthetics.

  1. Download a Theme: Choose a theme from iTerm2 Color Schemes. This website offers a wide variety of color schemes to choose from.
  2. Import the Theme:
    • Open iTerm2 and navigate to Preferences > Profiles > Colors > Color Presets > Import.
    • Select the downloaded theme file to import.
  3. Apply the Theme: In Color Presets, select your imported theme to apply it. You can experiment with different themes until you find the perfect one.

Step 5: Additional Customizations

  1. Fonts: To ensure all icons and symbols display correctly, use a powerline-patched font. Download and install a font like Fira Code. Here’s how:
    • Download the font from the repository.
    • Open the downloaded folder and install the font files by double-clicking them.
    • In iTerm2, navigate to Preferences > Profiles > Text and select your newly installed font.
  2. Transparency and Blur: Adjust transparency and blur settings to add a modern touch to your terminal:
    • In iTerm2, go to Preferences > Profiles > Window.
    • Adjust the transparency and blur sliders to your liking.
  3. Background Image: Set a background image for an extra personal touch. Go to Preferences > Profiles > Window and select your desired image. This can make your terminal look unique and personalized.

Step 6: Add Useful Plugins

Oh My Zsh supports a variety of plugins. Here are a few recommendations:

  1. zsh-syntax-highlighting: This plugin provides syntax highlighting for your command line input, making it easier to spot errors.
    • Install by running:
brew install zsh-syntax-highlighting

Add the following line to your .zshrc file:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  1. zsh-autosuggestions: This plugin suggests commands as you type based on your command history.

Install by running:

brew install zsh-autosuggestions

Add the following line to your .zshrc file:

source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

Final Touches

After following these steps, your terminal should be both beautiful and functional. Enjoy the enhanced coding experience with your new setup! Please do not overdo it with plugins and add-ons, as these can slow your terminal down!

Experiment with different themes, fonts, plugins, and settings until you find the perfect combination that suits your style. The terminal is a powerful tool; making it visually appealing can make your coding sessions more enjoyable and productive. As a developer, It ought to be something you can’t wait to tinker with day after day.

Link this article
Est. reading time: 4 minutes
Stats: 328 views

Categories

Products and courses