1. 先安装zsh, on-my-zsh
sudo apt install zsh
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
2.设置主题:
vi ~/.zshrc
#### 修改主题
ZSH_THEME="agnoster"
#### 安装 powerline 字体
sudo apt-get install fonts-powerline
主题 bira 也不错
3.设置zsh 不显示用户名和host
vi ~/.zshrc
#### 最后添加
-------------------------------------
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
#prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
prompt_segment black default "%(!.%{%F{yellow}%}.)"
fi
}
------------------------------------
4. 安装 zsh-autosuggestions 插件
# clone 插件到 on-my-zsh 插件路径
git clone https://gitee.com/phpxxo/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# 修改 .zshrc 配置 插件
vi ~/.zshrc
---------------------------------------------------------------------
plugins=(git
zsh-autosuggestions
)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=yellow'
----------------------------------------------------------------------
source ~/.zshrc
网友评论