After a long time restoring backups from previous laptops I decided to go with a fresh install which made me look for a lot of things I had already configured to my needs so I decided to write this as a cheatsheet/reminder for myself but also share it here for anyone to use it.
This is a step by step guide on how to install iTerm, PREZTO and my current config of them.
Install iTerm using Homebrew
$ brew cask install iterm2
Install zsh and zsh-completions using Homebrew
$ brew install zsh zsh-completions
Go to iTerm > Preferences > Profiles > General. Under Command, select “Command” (rather than “Login Shell”) and enter /bin/zsh --login
As a visual thing I always like to change the theme to Solarized Dark which you can do from the Preferences menu under Profiles > Color
You will start seeing some amazing features by default such as your current branch and different symbols depending if you have new or modified files.
Prezto installs on top of zsh
$ git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
Create a ~/.zshrc file
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
Edit ~/.zpreztorc file and add all the modules you want. It is VERY important to know that the order in which the modules are loaded matter so for example prompt must go last with history-substring-search right before it and then syntax-highligting.
This is how my modules piece of the file looks like:
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'git' \
'syntax-highlighting' \
'history-substring-search' \
'prompt'
completionadd tabs completion for lots of commands.directoryhas shortcuts for fast navigation such as using2to show the directory stack or a numer1 ... 9to go immediately to that directory.syntax-highlightinghighlights builtins, commands and functions in blue and show red when a command is wrong or incomplete.history-substring-searchworks together withhistoryand allows you to do a search.
There are a lot more modules that you can enable/disable. Check the README files of each one of them.