Below is a quick-start guide to get a lot of zshell goodness. It should take you no longer than 30 minutes to go through the whole guide.
Once you've completed the below steps, you should have lots of nice goodies.
Some examples:
- A customisable shell prompt which can display all kinds of information
- Better
tab
suggestions when "tabbing" on any command (likecd
,npm run
,git checkout
etc.) - Better
tab
suggestion navigation and search - Press
ctrl + r
to easily search all of your command history withfzf
- Partially type any command, and then press
up
anddown
to cycle through the history filtered by the partial search - Type
cd**<TAB>
to triggerfzf
(fuzzy finder - more info) fnm
will make sure to use the right node version for whatever folder you navigate to (whenever there is anode_version
file in that folder)- Use all of the git plugin aliases such as
grbi
instead ofgit rebase -i
grbc
instead ofgit rebase --continue
gcb
instead ofgit checkout -b
- Have a much better looking diff when running
git diff
from terminal
And plenty more that I probably can't even remember.
- Install fzf - on MacOS:
brew install fzf
- Install fnm - on MacOS:
brew install fnm
- Install Angular CLI (optional):
npm install -g @angular/cli
- If you don't work with angular, you can decide to skip this, but make sure to remove the last line from my example zshrc below (angular cli related stuff)
If you have a zshrc file already, make sure to make a backup.
mv ~/.zshrc ~/.zshrc.bak
Installing the right font ensures that the ligatures (fancy icons in the terminals) display correctly.
You can head over to nerd font and choose a font, or just install the recommended font by p10k: "Meslo LG". On MacOS, with the following command:
brew install --cask font-meslo-lg
Make sure to update your terminal / VSCode settings to use the new font.
If you have VSCode installed (and, on MacOS, you have added code
to your PATH), then you can create the new file like this:
code ~/.zshrc
Copy paste the contents of zshell configuration file (.zshrc
) below into this file.
Close existing terminals. Open a new terminal and follow the theme configuration wizard.
Maybe you had things in your old zshrc file that you realise are missing in the new one. Hard to predict. Add back whatever you need from the ~/.zsrch.bak
file you created earlier as necessary.
Following the theme configuration wizard will create a new file in ~/.p10k.zsh
. You can edit this file to your pleasing. You can use my personal .p10k.zsh
file for inspiration if you like.