WindowsTerminal
相比傳統(tǒng)的cmd和PowerShell,WindowsTerminal更智能且界面也更美觀
wsl2
用來(lái)創(chuàng)建win10下的子虛擬機(jī)
- 安裝WSL2和ubuntu虛擬機(jī)可以參考微軟官方文檔: 在 Windows 10 上安裝 WSL | Microsoft Docs ,安裝后先啟動(dòng)一下第一次會(huì)比較慢并且需要配置用戶(hù)名和密碼。
然后在微軟自帶的應(yīng)用商店中找到WindowsTerminal并安裝
在windowsTerminal中可以設(shè)置默認(rèn)配置文件這樣打開(kāi)windowsTermin就是我們的子虛擬機(jī)了在ubuntu中安裝zsh
首先需要在系統(tǒng)中配置git賬號(hào),之后會(huì)頻繁用到git,配置方法可以參考:ubuntu配置git
安裝zsh
sudo apt update
sudo apt install git zsh -y
- 安裝oh my zsh
直接git clone比較慢可以在~/.bashrc末尾加上一下語(yǔ)句:
export hostip=$(cat /etc/resolv.conf |grep nameserver | awk '{ print $2 }')
export https_proxy="http://${hostip}:1080"
export http_proxy="http://${hostip}:1080"
端口號(hào)根據(jù)自己的SSR本地端口進(jìn)行對(duì)應(yīng)改動(dòng)(更多->選項(xiàng)設(shè)置)
安裝oh my zsh所需的字體
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
返回上一級(jí)刪除 fonts 文件
cd ..
rm -rf fonts
安裝oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- 安裝歷史命令自動(dòng)補(bǔ)全
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中兩個(gè)剛剛下載好的插件名字加進(jìn)去,然后保存退出
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
最后更新一下配置文件
source .zshrc
安裝成功
- 設(shè)置zsh為默認(rèn)shell
查看zsh所在位置
whereis zsh
如果有多個(gè)值 以 xxx/bin/zsh 為準(zhǔn)
然后:
chsh -s xxx/bin/zsh
執(zhí)行之后注銷(xiāo)重新登陸即可
安裝皮膚
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
然后設(shè)置.zshrc文件的ZSH_THEME="powerlevel10k/powerlevel10k"
卸載wsl子系統(tǒng)
首先查看本機(jī)安裝了哪些子系統(tǒng):
wsl --list --all
其次:
wsl --unregister <System_name>
到其路徑下將全部文件刪除即可