Improved Terminal Experience with Oh My Zsh, iTerm2, PowerLevel10K

I have optimised my iTerm setup with a number of plugins to increase my productivity – Using powerlevel10k on iTerm2 with OhMyZsh with plugins. If you want to copy my config, checkout my dotfiles on Github – https://github.com/magicdude4eva/dotfiles:

iTerm with Powerlevel10K theme

Installing Homebrew

The most popular package manager for macOS is called Homebrew, or brew for short. We will use it to install the rest. First we need to install CLI tools for Xcode. Open a terminal and run this command:

xcode-select —-install

To install brew you simply open a terminal and paste this command:

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

Installing iTerm2

You can download the app manually from the iTerm2 website or you can save yourself some trouble by using cask which helps you install apps from the command line. Open your terminal and write the following commands:

brew install cask
brew cask install iterm2

Customising iTerm

Installing Oh My Zsh

Install it by opening iTerm and write the command:

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

Install Oh My Zsh plugins

zsh-autosuggestions is a great plugin that will suggest auto completions based on what you type.

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

zsh-completion aims at gathering/developing new completion scripts that are not available in Zsh yet

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

zsh-syntax-highlighting provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.

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

Next, edit your ~/.zshrc file to activate it. Add the plugins to the list of plugins:

plugins=(evalcache zsh-nvm osx git npm zsh-autosuggestions zsh-completions zsh-syntax-highlighting sublime)

Install PowerLevel10K

Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.

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

Next, edit your ~/.zshrc file to activate it. Adjust the THEME-setting:

ZSH_THEME="powerlevel10k/powerlevel10k"

Open a new terminal tab and if the powerlevel10k setup does not start, run it manually:

p10k configure

Fuzzy find everything

fzf is a general-purpose command-line fuzzy finder. It’s an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc. Activate it with CTRL+R:

Fuzzy Find everything

brew install fzf

Install the keybindings and completion

/usr/local/opt/fzf/install

Update your .zshrc:

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

Forgit

forgit is an utility tool for using git interactively. This tool is designed to help you use git more efficiently. It’s lightweight and easy to use.

forgit - using git interactively

Install via Cloning into plugins:

git clone https://github.com/wfxr/forgit ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/forgit

Source via .zshrc:

[ -f ~/.oh-my-zsh/custom/plugins/forgit/forgit.plugin.zsh ] && source ~/.oh-my-zsh/custom/plugins/forgit/forgit.plugin.zsh

Delta – better git diffs

git-delta aims to make this both efficient and enjoyable: it allows you to make extensive changes to the layout and styling of diffs, as well as allowing you to stay arbitrarily close to the default git/diff output.

git-delta - command line diff tool

Install via brew:

brew install git-delta

Adjust your git global via git config --global -e:

...
[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only	
[delta]
    features = side-by-side line-numbers decorations
    syntax-theme = Monokai Extended	
    line-numbers = true
    plus-color = "#012800"
    minus-color = "#340001"
    side-by-side = false
    whitespace-error-style = 22 reverse
[delta "decorations"]
    commit-decoration-style = bold yellow box ul
    file-style = bold yellow ul
    file-decoration-style = none
...

 


🍺 Pay it forward: If any of my content helped you in any way, then follow me on Twitter or send me some coins:
(BTC)    36nBgsAhBBzkTvJMut851XVj47bUrdsmQx
(ETH)    0xE572b3B1187a3Ab77D72f7d6AeCd18DF26306cfC
(BAT)    0x48c65D6f768D92d4a23E4e9d25329E7De67c14d9
(LTC)    M8TNsiQWe591HTkDtLubZeftbejfPMcoUy
(Ripple) rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg (Tag: 2478959347)
(XLM)    GDQP2KPQGKIHYJGXNUIYOMHARUARCA7DJT5FO2FFOOKY3B2WSQHG4W37 (Memo ID: 909493707)
Affiliates: Binance (#altcoins), Coinbase (buy/sell ETH/BTC, get 10$), CoinTracking.info (get 10% off), TradingView (trend reports) or old-school PayPal.