WindowsTerminal + wsl2 + ubuntu

2021-06-18  本文已影响0人  f109

WindowsTerminal

相比传统的cmd和PowerShell,WindowsTerminal更智能且界面也更美观

wsl2

用来创建win10下的子虚拟机

sudo apt update
sudo apt install git zsh -y
export hostip=$(cat /etc/resolv.conf |grep nameserver | awk '{ print $2 }')
export https_proxy="http://${hostip}:1080"
export http_proxy="http://${hostip}:1080"

端口号根据自己的SSR本地端口进行对应改动(更多->选项设置)

安装oh my zsh所需的字体

git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh

返回上一级删除 fonts 文件

cd ..
rm -rf fonts

安装oh my zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

安装完改一下配置文件

vim ~/.zshrc#或者gedit ~/.zshrc

把plugins中两个刚刚下载好的插件名字加进去,然后保存退出

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

最后更新一下配置文件

source .zshrc

安装成功

whereis zsh

如果有多个值 以 xxx/bin/zsh 为准
然后:

chsh -s  xxx/bin/zsh

执行之后注销重新登陆即可

安装皮肤

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

然后设置.zshrc文件的ZSH_THEME="powerlevel10k/powerlevel10k"

卸载wsl子系统

首先查看本机安装了哪些子系统:

wsl --list --all

其次:

wsl --unregister <System_name>

到其路径下将全部文件删除即可

上一篇 下一篇

猜你喜欢

热点阅读