Setting Up a Productive Programmer's Terminal

Setting Up a Productive Programmer’s Terminal

As a programmer, having a handy terminal and efficiency are essential skills. In this article, we will walk you through the process of installing and configuring a programmer’s terminal on Mac OS.

Software Installation

Before we dive into the installation process, let’s first list the software that we need to install:

  • iterm2: A terminal emulator that provides a better user experience.
  • dracula theme: A theme for iTerm2 that provides a dark and stylish look.
  • Oh My ZSH: A framework for managing and customizing ZSH shells.
  • powerlevel9k: A theme for Oh My ZSH that provides a high-performance and customizable shell.

Installing iTerm2

To install iTerm2, follow these steps:

  1. Download: Go to the official website of iTerm2 and download the installation package.
  2. Install: Click on the downloaded package to install iTerm2.

Alternatively, you can use the command line to install iTerm2 using brew:

  1. Install: Run the command brew cask install iterm2 to install iTerm2.

Using iTerm2

Once you have installed iTerm2, you can start using it by opening the application. You can also use the following shortcuts to navigate through the application:

  • CMD + Click: Jump to the selected text.
  • Document: Learn about the focus of the document.

Configuring Dracula Theme

To configure the Dracula theme, follow these steps:

  1. Clone: Clone the Dracula theme repository using the command git clone https://github.com/dracula/iterm.git.
  2. Direct download: Directly download the Dracula theme package from GitHub.
  3. Unzip: Unzip the downloaded package.
  4. Import: Import the Dracula theme into iTerm2 by following these steps:
    • Open iTerm2 > Preferences > Profiles > Colors Tab.
    • Choose the color scheme.
    • Select Import and choose the Dracula theme package.

Installing Oh My ZSH

To install Oh My ZSH, follow these steps:

  1. Installation: Run the command brew install zsh zsh-completions to install ZSH.
  2. Switch shell: Run the command chsh -s /bin/zsh to switch to the ZSH shell.
  3. Install Oh My ZSH: Run the command sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" to install Oh My ZSH.

Configuring Powerlevel9k

To configure Powerlevel9k, follow these steps:

  1. Clone: Clone the Powerlevel9k repository using the command git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k.
  2. Configuration: Configure the Powerlevel9k theme in the .zshrc file by adding the following lines:
    • ZSH_THEME="powerlevel9k/powerlevel9k"
    • POWERLEVEL9K_MODE="nerdfont-complete"
    • POWERLEVEL9K_PROMPT_ON_NEWLINE=false
    • POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(virtualenv os_icon user dir_writable dir vcs)
    • POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status)
    • POWERLEVEL9K_USER_ICON="\uF415" #
    • POWERLEVEL9K_ROOT_ICON="\uF09C" #
    • POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"

Configuring Plugins

To configure plugins, follow these steps:

  1. Add plugins: Add the following plugins to the .zshrc file:
    • plugins=(git man zsh-syntax-highlighting zsh-autosuggestions autojump)
  2. Source: Source the .zshrc file by running the command source ~/.zshrc.

Setting Up Fonts

To set up fonts, follow these steps:

  1. Clone: Clone the Powerline fonts repository using the command git clone https://github.com/powerline/fonts.git.
  2. Install: Install the Powerline fonts by running the command cd fonts && ./install.sh.
  3. Clean-up: Clean up the fonts repository by running the command cd .. && rm -rf fonts.

Setting Up Icons

To set up icons, follow these steps:

  1. Clone: Clone the Powerlevel9k repository using the command git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k.
  2. Configuration: Configure the Powerlevel9k theme in the .zshrc file by adding the following lines:
    • ZSH_THEME="powerlevel9k/powerlevel9k"
    • POWERLEVEL9K_MODE="nerdfont-complete"
    • POWERLEVEL9K_PROMPT_ON_NEWLINE=false
    • POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(virtualenv os_icon user dir_writable dir vcs)
    • POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status)
    • POWERLEVEL9K_USER_ICON="\uF415" #
    • POWERLEVEL9K_ROOT_ICON="\uF09C" #
    • POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"

By following these steps, you can set up a productive programmer’s terminal on Mac OS.