deepin安装oh my Zsh
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
使用 linux
这些年,发行版本用了很多,但是一直用的默认的 bash
,最近浏览公众号和 github
被不同人安利了 Zsh
,据说很强大,于是准备尝试下。
oh my Zsh
基于 Zsh
,所以先安装 Zsh
linux
安装比较简单,直接安装即可
# 安装
sudo apt-get install zsh
# 查看版本
zsh --version
# 设置为默认shell
chsh -s $(which zsh)
# 注销并重新登录以使用最新的默认shell
推荐使用方法二 ::: info 方法一 WSL
安装 Zsh
: windows
需要先去商店安装 WSL
, 然后选择一个 linux
子系统,比如 ubuntu
, 然后在选择 ubuntu
终端安装 Zsh
apt-get install zsh
windows
子系统中无法和系统共享环境和目录,所以很多 Zsh
命令无法正常使用, 比如 vsc .
等,不是很方便 ::: ::: info 方法二 以 Git Bash
终端为基础,来安装 Zsh
终端
将解压的文件和目录一起放入 git bash
的安装目录, 一般是在 C:\Program Files\Git
将 zsh
设为默认 bash
# 在~目录建立.bashrc文件
cd ~
touch .bashrc
# 编辑文件
if [ -t 1 ]; then
exec zsh
fi
# 重启git bash 终端
# 然后就和上面的linux步骤一样下载脚本安装 oh my Zsh
:::
::: warning 注意 如果遇到网络问题无法正常安装,可以尝试将 vpn
配置为系统代理
或者 科学上网-让终端走代理 :::
oh my Zsh
拥有强大的插件,可以安装一些常用的插件,比如 zsh-autosuggestions
插件,可以自动提示命令
::: code-group
# 常用插件
plugins=(git git-commit docker extract colored-man-pages codeclimate mysql-macports npm nvm pip pm2 shell-proxy sudo systemd ubuntu vscode)
:::