How To Customize Your macOS Terminal

Step 1: Setting A Theme

git clone https://github.com/nathanbuchar/atom-one-dark-terminal.git

Step 2: Setting Preferences

Text Tab

Window Tab

Tab Tab

Shell Tab

Keyboard Tab

Step 3: Configuring .bash_profile

cd ~
touch .bash_profile
nano .bash_profile
source ~/.bash_prompt
source ~/.aliases

Step 4: Configuring .bash_prompt

touch .bash_prompt
nano .bash_prompt
#!/usr/bin/env bash
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# TERMINAL PROMPT
PS1="\[\e[0;93m\]\u\[\e[m\]" # username
export PS1;
PS1+=" "    # space
PS1+="\[\e[0;95m\]\W\[\e[m\]"    # current directory
#PS1+=" "      # space
#PS1+=">> " # end prompt
# GIT FUNCTIONS
git_branch() {
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1+="\[\e[0;92m\]\$(git_branch)\[\e[m\]".   # current branch
#!/usr/bin/env bash

# GIT FUNCTIONS
git_branch() {
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# TERMINAL PROMPT
PS1="\[\e[0;93m\]\u\[\e[m\]" # username
PS1+=" " # space
PS1+="\[\e[0;95m\]\W\[\e[m\]" # current directory
PS1+="\[\e[0;92m\]\$(git_branch)\[\e[m\]" # current branch
PS1+=" " # space
PS1+=">> " # end prompt
export PS1;
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

Step 5: Configuring .aliases

nano .aliases
#!/usr/bin/env bash
# NAVIGATION
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# COMMON DIRECTORIES
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias dc="cd ~/Documents"
alias p="cd ~/Documents/projects"
alias home="cd ~"
# GIT
alias g="git"
alias gs="git status"
alias gd="git diff"
alias gb="git branch"
alias gm="git checkout master"
# SHOW/HIDE HIDDEN FILES
alias showhidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder
alias hidehidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder
# SHOW/HIDE DESKTOP ICONS
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder
# EASIER DOTFILE EDITING
alias aliases="nano ~/.aliases && . ~/.aliases"
alias bashprofile="nano ~/.bash_profile && . ~/.bash_profile"

Step 6: Cleaning Up

touch .hushlogin

--

--

--

Senior Software Developer at Shopify

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Save Time with Question Mapping in Dubsado

Laravel where and orWhere Condition Example

Specification Design Pattern in Java 8

Naive Bayes Classifier: A Naive Gopher Approach

Girl, develop insecurity! What I learned after completing my coding bootcamp and wish I knew then.

Object-Oriented Programming (OOP) vs Data-Oriented Tech Stack (DOTS) in Unity

#100DaysOfCode — My Own Experience Of The Challenge

READ/DOWNLOAD#! Starting out with Visual C# FULL BOOK PDF & FULL AUDIOBOOK

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Charles Dobson

Charles Dobson

Senior Software Developer at Shopify

More from Medium

How to use multiple GitHub accounts on your Mac

Customizing your development terminal

Loading order of .bash_profile or .bashrc: Unix & macOS

ITerm 2 & ZSH script for Git Branch