Set up Terminal on Mac 2022

Setting up new Terminal on Mac

iTerm2
Homebrew
Git
Zsh (Z Shell) and ohmyzsh
ohmyzsh Themes
ohmyzsh Plugins
iTerms2 Color Schemes

1. iTerm2

Download at iterm2.com/downloads

Set out Status Bar Component Menu
iTerm2 > Prefere…


This content originally appeared on DEV Community and was authored by Lana Kushnir

Setting up new Terminal on Mac

  • iTerm2
  • Homebrew
  • Git
  • Zsh (Z Shell) and ohmyzsh
  • ohmyzsh Themes
  • ohmyzsh Plugins
  • iTerms2 Color Schemes

1. iTerm2

Download at iterm2.com/downloads

Set out Status Bar Component Menu
iTerm2 > Preferences > Profiles > Session > Status bar enabled > Configure Status Bar

Check out other features at iterm2.com/features

2. Homebrew

Download at brew.sh
or run this in terminal

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It will automatically install Developer tools if not available in your system.
When installation is done, run the two commands from the "==> Next steps:" section found in output of your terminal
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/lana/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

3. Git

Mac already comes with git installed
git --version
=> git version 2.30.1 (Apple Git-130)
Get the latest version of git by installing it with Homebrew

brew install git

git --version
=> git version 2.36.1
Double-check your git global configurations
git config --global --list
If your user.email and user.name are not set, run the following to set your git global configurations
git config --global user.email "<youremail>"
git config --global user.name "<yourname>"
Reference: git-scm.com/download

4. zsh and ohmyzsh

zsh

Mac already comes with zsh installed and set as a default
Check what shell is set as a default
echo $SHELL
=> /bin/zsh
If the return is not the above, install zsh with Homebrew

brew install zsh

zsh --version
=> zsh 5.8.1 (x86_64-apple-darwin21.0)
Then Change the default shell in Terminal on Mac or run the following
chsh -s $(which zsh)

ohmyzsh

Install ohmyzsh, the following will run the install script from Github ohmyzsh's install.sh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Reference: ohmyz.sh

5. ohmyzsh Themes

Pick a theme for your ohmyzsh look, and there are many available at Github: ohmyzsh Themes wiki page
What's the best theme for Oh My Zsh?
Reddit: What are some of the best Zsh themes

The most popular theme is PowerLevel10k

Install PowerLevel10K theme

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

open ~/.zshrc
find a line ZSH_THEME=" and update it
ZSH_THEME="powerlevel10k/powerlevel10k"

Change PowerLevel10k configurations
p10k configure
Change iTerm2 font (reddit reference)

  • Quit iTerm2 - iTerm2 > Quit iTerm2 or press ⌘ Q.
  • Start iTerm2.
  • Click iTerm2 > Preferences > Profiles > Text.
  • If you have multiple profiles, on the left, click the one you want to change.
  • Adjust Font on the right.

6. ohmyzsh Plugins

A list of all ohmyzsh plugins is available at Github ohmyzsh/plugins
or run ls ~/.oh-my-zsh/plugins
To see which plugins are enabled, run
echo $plugins

There are also lots of custom plugins built within zsh-users community. Install the following custom plugins:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions

open ~/.zshrc
find the line source "$ZSH/oh-my-zsh.sh"
add the following before that line

fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
  • Activate custom plugins

open ~/.zshrc
find a line plugins=( and update it

plugins=(
git 
zsh-autosuggestions 
zsh-syntax-highlighting
zsh-completions 
)

7. iTerm Color Schemes

Github mbadolato/iTerm2-Color-Schemes
Import color schemes into iTerms 2

cd Downloads
wget https://github.com/mbadolato/iTerm2-Color-Schemes/archive/refs/heads/master.zip
unzip master.zip

You may need to install wget and unzip Homebrew formulae
brew install wget
brew install unzip
Import .itemcolors items found at ~/Downloads/iTerm2-Color-Schemes-master/schemes
iTerm2 > Preferences > Profile > Colors > Color Presets > Import

To delete them later, follow this Bulk remove iTerm2 color schemes guide.

References:


This content originally appeared on DEV Community and was authored by Lana Kushnir


Print Share Comment Cite Upload Translate Updates
APA

Lana Kushnir | Sciencx (2022-06-23T02:20:56+00:00) Set up Terminal on Mac 2022. Retrieved from https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/

MLA
" » Set up Terminal on Mac 2022." Lana Kushnir | Sciencx - Thursday June 23, 2022, https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/
HARVARD
Lana Kushnir | Sciencx Thursday June 23, 2022 » Set up Terminal on Mac 2022., viewed ,<https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/>
VANCOUVER
Lana Kushnir | Sciencx - » Set up Terminal on Mac 2022. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/
CHICAGO
" » Set up Terminal on Mac 2022." Lana Kushnir | Sciencx - Accessed . https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/
IEEE
" » Set up Terminal on Mac 2022." Lana Kushnir | Sciencx [Online]. Available: https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/. [Accessed: ]
rf:citation
» Set up Terminal on Mac 2022 | Lana Kushnir | Sciencx | https://www.scien.cx/2022/06/23/set-up-terminal-on-mac-2022/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.