Skip to content

Latest commit

 

History

History
149 lines (101 loc) · 2.49 KB

04-setup-terminal-zsh.md

File metadata and controls

149 lines (101 loc) · 2.49 KB

Setup terminal and zsh

Catalina comes with zsh as the default shell.

Check Version

zsh --version
which zsh

Install Oh My Zsh.

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

Re Add NVM to .zshrc

#.zshrc
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# This loads nvm

Update Changes

source ~/.zshrc

Nerd Font

Download MesloLGS NF Font

Install Theme

$ZSH_CUSTOM is the director for Oh My Zsh custom ~/.oh-my-zsh/custom

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

Install Plugins

git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

nano ~/.zshrc

Update .zshrc

#.zshrc
#change theme
ZSH_THEME="powerlevel10k/powerlevel10k"

#auto correction
ENABLE_CORRECTION="true"

#add plugins
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

update changes

source ~/.zshrc

Permissions Issue

You might get a Permission issue when updating the changes.

First Method Fix

# .zshrc
# Path to your oh-my-zsh installation.
ZSH_DISABLE_COMPFIX=true
export ZSH="/Users/cwc/.oh-my-zsh"

Second Method Fix

If the first method doesn't work

chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functions

update changes

source ~/.zshrc

p10k

Configure p10k theme.

#run configuration
p10k configure

p10k configuration file .p10k.zsh

Shorten up your directory path

nano ~/.p10k.zsh
#.p10k.zsh
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_last

typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1

Terminal Themes

https://github.com/lysyi3m/macos-terminal-themes

  • Molokai (I use)

Table of Content