-
安装zsh
注意:需要先安装git
yum -y install zsh wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
-
切换到
zsh
模式zsh
-
安装插件
zsh-syntax-highlighting
cd /root/.oh-my-zsh/custom/plugins git clone https://gitee.com/pankla/zsh-syntax-highlighting.git
git clone https://hub.fastgit.org/zsh-users/zsh-syntax-highlighting.git
-
安装插件
zsh-autosuggestions
cd /root/.oh-my-zsh/custom/plugins git clone https://gitee.com/pankla/zsh-autosuggestions.git
git clone https://hub.fastgit.org/zsh-users/zsh-autosuggestions
-
安装插件
zsh-completions
cd /root/.oh-my-zsh/custom/plugins git clone https://gitee.com/wangnd/zsh-completions.git
-
修改文件 /root/.zshrc
vim /root/.zshrc
修改主题:
ZSH_THEME="agnoster"
添加相关插件
plugins=( git zsh-syntax-highlighting zsh-autosuggestions zsh-completions)
添加命令别名
alias sz='source /root/.zshrc'
添加按键映射
bindkey "\e[1~" beginning-of-line bindkey "\e[4~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "^H" backward-delete-word bindkey "\e[8~" end-of-line bindkey "\e[7~" beginning-of-line bindkey "\eOH" beginning-of-line bindkey "\eOF" end-of-line bindkey "\e[H" beginning-of-line bindkey "\e[F" end-of-line bindkey '^i' expand-or-complete-prefix
让配置文件生效
source /root/.zshrc
Linux安装zsh
于 2022-05-15 15:20:41 首次发布