Zshell on mac
zshell
Nowdays mac os comes with zshell
as default shell. You can check it with
echo $0
iterm 2
brew install iterm2
Color schemas
You can download color schema from https://iterm2colorschemes.com/
Oh My Zsh
https://github.com/ohmyzsh/ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
You may need to run
compaudit | xargs chmod g-w,o-w
In ~/.zshrc
you may need to copy your initialization code from ~/.zshrc.pre-oh-my-zsh
.
Autosuggestion
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Add plugins
In ~/.zshrc
add the following
plugins=(
git
bundler
kubectl
pipenv
docker
docker-compose
virtualenv
zsh-autosuggestions
z
)
Git
- gc - git commit
- gst - git status
- gp – git push
Powerline
Powerline fonts
https://github.com/powerline/fonts
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts
We need to set both the Regular font and the Non-ASCII Font in “iTerm > Preferences > Profiles > Text” to use a patched font
Theme
In ~/.zshrc
add
ZSH_THEME="agnoster"
powerlevel9k
https://github.com/Powerlevel9k/powerlevel9k
brew tap sambadevi/powerlevel9k
brew install powerlevel9k
In ~/.zshrc
add the following
source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme
Alternatively you can:
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
Nerd fonts
https://github.com/ryanoasis/nerd-fonts#option-4-homebrew-fonts
brew tap homebrew/cask-fonts
brew install font-hack-nerd-font
Then change theme in ~/.zshrc
by
POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel9k/powerlevel9k"
prompt
Agian inn ~/.zshrc
:
POWERLEVEL9K_VIRTUALENV_BACKGROUND=107
POWERLEVEL9K_VIRTUALENV_FOREGROUND='white'
POWERLEVEL9K_PYENV_BACKGROUND=110
POWERLEVEL9K_PYENV_FOREGROUND='white'
POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(virtualenv pyenv dir newline os_icon vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time ram battery)
Finally you ~/.zshrc
would look like:
export ZSH="/Users/bartekskorulski/.oh-my-zsh"
plugins=(
git
bundler
kubectl
pipenv
docker
docker-compose
virtualenv
zsh-autosuggestions
z
)
source $ZSH/oh-my-zsh.sh
POWERLEVEL9K_VIRTUALENV_BACKGROUND=107
POWERLEVEL9K_VIRTUALENV_FOREGROUND='white'
POWERLEVEL9K_PYENV_BACKGROUND=110
POWERLEVEL9K_PYENV_FOREGROUND='white'
POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(virtualenv pyenv dir newline os_icon vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time ram battery)
POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel9k/powerlevel9k"
source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme
Updated: 2021-10-21