Install oh-my-zsh+powerlevel10k on MAC to create and modify personalized terminals

First upload the final configuration picture

insert image description here

  • First install git (recommended to install via brew)
brew install git
  • Install oh-my-zsh (because of Q, it is recommended to search for oh-my-zsh directly on gitee), you can also use the following command
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)"

There may be related problems during the actual installation process, you can use the following command

git clone [email protected]:mirrors/oh-my-zsh.git

sh oh-my-zsh/tools/install.sh
  • To install the powerlevel10k theme, please directly search for "powerlevel10k" on gitee, switch to the zsh theme directory, and clone it through git
cd .oh-my-zsh/themes
git clone https://gitee.com/gogopowerrangerfyf/powerlevel10k.git
  • Install the necessary zsh plug-ins, code highlighting and code prompt plug-ins need to be installed, please Baidu for specific plug-in details ~ /.oh-my-zsh/plugins is the plug-in that comes with zsh, if not, you need to install it yourself
brew install zsh-autosuggestions zsh-syntax-highlighting
  • Configure zsh (vim .zshrc), mainly modify two places, one is ZSH_THEME, the other is plugins, specific themes and plug-ins need to be modified according to your own preferences, the following is my configuration, for reference only
ZSH_THEME="powerlevel10k/powerlevel10k"
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

plugins=(
extract
git
gitignore
rand-quote
themes
thefuck
zsh-autosuggestions
zsh_reload
zsh-syntax-highlighting
z
)
  • Install related fonts. In order to better display related icons and avoid garbled characters, the specific download link is as follows. After downloading hack nerd font, unzip it directly and double-click to install it (generally only need to install Hack Regular Nerd Font Complete.ttf)

Font download click

  • Configure powerlevel10k
# 运行配置向导进行配置
p10k configure
  • After the configuration is complete, restart the terminal

Guess you like

Origin blog.csdn.net/jinba225/article/details/116572521