请稍侯

ohmyzsh及其插件的安装 安

09 April 2023

ohmyzsh及其插件的安装

安装zsh

yum install zsh 
# 或
apt install zsh

安装ohMyZsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

安装ohmyzsh插件

git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-autosuggestions

git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting


# 编辑.zshrc  
plugins=(
    git
    # other plugins...
    zsh-autosuggestions
    zsh-syntax-highlighting
)

https://paste.wodedata.com/pasta/e9GlYb

让 Prompt 显示 username 与 hostname 编辑 vim .zshrc 在最后添加:

PROMPT="$fg[cyan]%}$USER@%{$fg[blue]%}%m ${PROMPT}"

# %n is the username
# %m is the hostname

参考: auto sugesstion for bash
ble.sh (Bash Line Editor) 提供了类似于 zsh-autosuggestions 的自动补全和语法高亮功能