Article directory
1. iTerm2 beautification
1.1 Environmental requirements
iTerm2
The biggest requirement for the environment is actuallyPowerLine
the requirement for fonts- This body comes from
NERD FONTS
NERD FONTS
Provides a variety of programmer fonts andicons
supplements the system
1.2 About font selection
Regarding this problem, previous tutorials told everyone to download and install the "xxx" font. In fact, it depends on personal preference. You can choose to download and install the font in the tutorial, or you can choose your favorite font (as long as it is a font
nerd fonts
of to achieve the corresponding effect), you can also download onlynerd fonts
the icons inHere is a list of commonly used fonts for you
FiraMono Nerd Font
Hac Nerd Font
(SpaceVim
favorite font)MesloLG Nerd Font
(many subjects likePower Level 10K
favorite fonts)
1.3 Font installation
- Use
HomeBrew
to install fonts.HomeBrew
I won’t go into details here.Mac
People who use them should have heard of it.- Unlike most other tutorials, this article uses two fonts to achieve the purpose of
Terminal
separate fonts andicons
separate management, so that future modifications of the fonts will not affecticons
the purpose.
JetBrainsMono Nerd Font
(Used to provide support for fonts, it’s all a matter of personal preference)Symbols Nerd Font
(For management toicons
provide support)
- There are two installation methods:
HomeBrew
(method used in this article)- Local installation
<FONT NAME>
: actually refers to the content in the red box in the picture above. The actual content depends on the font.<FONT_PATH>
: refers to the font path ofNERD FONTS
the project ongithub
HomeBrew
Way
brew tap homebrew/cask-fonts && brew install --cask font-<FONT NAME>-nerd-font
- Local installation method
curl -fLo "<FONT NAME> Nerd Font Complete.otf" \
https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/<FONT_PATH>/complete/<FONT_NAME>%20Nerd%20Font%20Complete.otf
./install.sh <FontName>
1.4 Oh My Zsh installation
Oh My Zsh
It is a powerful set of terminal configuration files. This article will not discuss it too much and only shows its beautification functions.- will be
zsh
set as default terminal
chsh -s /bin/zsh
- Install
Oh My Zsh
There are two installation methods, one is
curl
method and the other iswget
method
curl
Way
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
wget
Way
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
oh my zsh
Catalog and functions
oh my zsh
.oh-my-zsh
After installation, a hidden folder named " will be created in the root directory to store the partyoh my zsh
's default configuration files and third-party configuration files.- User configuration files are mainly placed
custom
in folders
cd ~/.oh-my-zsh/
tree
.oh-my-zsh文件
├───plugins # 自带插件目录,每个插件目录下都有一个 README,有详细使用说明
├───themes # 自带主题目录
└───custom # 用户自定义目录
├───plugins # 第三方插件目录
└───themes # 第三方主题目录
1.6 Install Powerlevel10k theme
- will be
powerlevel10k
installed~/.oh-my-zsh/custom/themes
into
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
- Modified
zsh
configuration files, settingsZSH_THEME="powerlevel10k/powerlevel10k
cd
vim .zshrc
- set up
iTerm2
- Test whether the font is successful and enter
iTerm2
useget_icon_names
- Set up
powerlevel10
security reminders step by step
p10k configure
2. About iTerm2 garbled characters and others
2.1 Garbled characters caused by fonts
This problem usually occurs at the beginning, that is, after the oh my zsh
installation the theme is modified to the built-in one angoster
( ZSH_THEME="agnoster"
). The system lacks the corresponding powerline
fonts, which causes this problem. It can be solved by installing any NERD FONTS
font.
2.2 Garbled icons caused by iTterm2 Arramgements configuration
Almost no one mentions the chaos caused by iTerm2
configuration. This is because the conditions for the occurrence of this problem are quite accidental and harsh. My personal guess is that the reason may be that a snapshot Arrangements
equivalent to a certain period is set iTerm2
, and its past configuration is saved. Since it is set to "start at boot", the current iTerm2
configuration is overwritten with the past configuration every time.
- When you start using it, it will only be used
iTerm2
as a built-in . Use all default settings and configure themTerminal
after using it for a period of time.Arrangements
- Later, we started to
iTerm2
beautify the , andicons
garbled characters began to appear at this time, andNERD FONTS
this problem could not be solved through installation. - It is very simple to solve this problem, just delete the original one and
Arrangements
reconfigure it.
2.3 Others
oh my zsh
A blue triangle appears after upgrading
Cancel
show mark indicators
it
- Background settings
references
- Detailed introduction to Mac iTerm2 configuration tutorial
- Mac item2 set window size
- Build a better-use Mac - Terminal
- iTerm+ohmyzsh+powerlevel10k instantly makes your terminal cool
- Knowledge points: iTerm2 + Oh My Zsh usage summary
- This iTerm2 + Oh My Zsh tutorial will help you become the most handsome guy on the street step by step.