在WSL中安装zsh终端

在WSL中安装zsh终端

cmder中设置:

新增task,名称为wsl::bash,右下方的方框内填写:

"%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl --distro-guid={f24dabf4-473d-4aa4-92fd-364654228b77} -cur_console:pm:/mnt

这里面的f24dabf4-473d-4aa4-92fd-364654228b77指的是Ubuntu的唯一标识符,如果重装了子系统,那么这个标识符实惠变得。可以在在注册表(regedit)中查找 计算机\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxsswin+R搜索regedit

安装zsh和oh-my-zsh

安装zsh

sudo apt-get install zsh

安装oh-my-zsh

wget https://files-cdn.cnblogs.com/files/hongdada/install.sh -O - | sh

安装类似fish shell的插件

自动补全插件

$ git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions

自动提示插件

$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

语法高亮插件

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

编辑.zshrc启用插件

ZSH_THEME="ys"
............................
plugins=(git zsh-completions zsh-autosuggestions zsh-syntax-highlighting)

zsh别名

参考:

Windows Subsystem for Linux 环境配置 (最新 1709 版)

WSL+cmder+oh-my-zsh美化win10命令工具(terminal)

猜你喜欢

转载自www.cnblogs.com/hongdada/p/11087557.html