Terminal Setup - Make your Mac terminal awesome
source link: https://dev.to/alagrede/terminal-setup-make-your-mac-terminal-awesome-4ecc
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
I recently installed my new MacBook and set up my terminal. Here I'll show you how to do the same for your MacBook.
The final result
This is the end result based on the delicious powerlevel10k. Easy to configure and modify. Optimized to work as a developer.
You will notice the toolbar at the top (Cpu, Ram, Network) to always have an overview of the hardware consumption.
Prerequisites
Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode
Exit fullscreen mode
Install iTerm2 and git
brew install --cask iterm2
brew install git
Enter fullscreen mode
Exit fullscreen mode
Install Oh My Zsh
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Enter fullscreen mode
Exit fullscreen mode
Theme installation
I choosed powerlevel10k probably one of the best and most flexible theme you can choose.
You can easily change your terminal layout simply by rerun the installation command.
Start to install MesloLGS Fonts
MesloLGS NF Regular.ttf
MesloLGS NF Bold.ttf
MesloLGS NF Italic.ttf
MesloLGS NF Bold Italic.ttf
Enter fullscreen mode
Exit fullscreen mode
Then install powerlevel10k itself
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Enter fullscreen mode
Exit fullscreen mode
In ~/.zshrc
set the ZSH theme to use:
ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
Enter fullscreen mode
Exit fullscreen mode
You will probably at least configure these two ZSH plugins:
zsh-syntax-highlighting - Fish shell like syntax highlighting for Zsh. This is what makes my aliases/commands green above. If it's green then it's installed!
zsh-autosuggestions - Fish-like autosuggestions for zsh. Will show a preview of the last matching command while typing. Press right to use
In ~/.zshrc
set the ZSH plugins to use:
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)
Enter fullscreen mode
Exit fullscreen mode
Restart your terminal with Zsh
Now you can run
p10k configure
Enter fullscreen mode
Exit fullscreen mode
If you have issue with fonts, check MesloLGS font is selected.Open iTerm2 → Preferences → Profiles → Text and set Font to MesloLGS NF
.
Finally, if you want to include your existing bash aliases and functions:
In ~/.zshrc
source your bash_profile just before the export ZSH
source ~/.bash_profile
Enter fullscreen mode
Exit fullscreen mode
Add the Toolbar
Open your iterm2 > Profile > Session > Status bar enabled
Select your widgets
Finished!
I hope this small tutorial will help you to improve your setup. It is obviously not complete but easy enough to move on.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK