- 启用zsh
- 修改当前用户使用的
shell为zsh
root@Linux:~# echo $SHELL ##查看当前用户的shell
/bin/bashroot@Linux:~# cat /etc/shells ##查看当前用户的shell,由下可知需要另行安装`zsh`
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/dash
/usr/bin/dash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
- 修改当前用户
shell为zsh
root@Linux:~# cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/dash
/usr/bin/dash
/bin/zsh ##zsh已经正确安装
root@Linux:~# chsh -s /bin/zsh ##修改当前用户shell为zsh
Changing shell for root.
Shell not changed.- 安装插件——zsh-autosuggestions 和zsh-syntax-highlighting
- 下载命令补全建议插件
zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions- 下载语法高亮插件
zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting- 修改配置文件.zshrc
vim ~/.zshrc- 修改如下选项
- 主题设置:
ZSH_THEME="re5et"
- 主题设置:
- 启用插件
plugins=(
git ##默认启用
z ##实现直接跳转到指定目录下,支持自动补全。语法:z 文件夹名称
zsh-autosuggestions ##命令补全建议插件
zsh-syntax-highlighting ##语法高亮
extract ##语法:x 压缩文件。解压文件而不需要知道它是何种压缩格式
)- 配置生效,执行
source ~/.zshrc参考文章: