記錄本人自用的環(huán)境
1 windows環(huán)境 wsl 以及 docker 安裝
將windows10系統(tǒng)更新到2004版本以上,或者直接用win11双谆,管理員啟動powershell狸捅,輸入命令wsl --install
即可自動完成安裝赌莺。自動安裝的最后一步會自動裝ubuntu系統(tǒng)司志,這一步在命令行會很慢甜紫,建議直接Ctrl+C
跳過這一步降宅,自己去windos商店下載ubuntu
訪問官網(wǎng)下載docker desktop:
Install Docker Desktop on Windows | Docker Documentation
2 網(wǎng)絡(luò)代理
進(jìn)入wsl 命令行直接運(yùn)行下面命令
docker run -d \
-p 2017:2017 \
-p 20170-20172:20170-20172 \
--restart=always \
--name v2raya \
-v /etc/v2raya:/etc/v2raya \
mzz2017/v2raya:v1.5.3
# v1.5.3之后的版本不知道為什么用不了骂远,懶得研究了
# 之后網(wǎng)頁訪問http://localhost:2017/設(shè)置代理服務(wù)器,不會就看官網(wǎng):https://github.com/v2rayA/v2rayA
# 修改系統(tǒng)代理
export http_proxy=localhost:20172
export https_proxy=localhost:20172
# 上面是臨時修改腰根,永久修改可以吧這個加入/etc/profile
設(shè)置好后本地windows也能使用這個代理激才,完美解決wsl命令行和windows同時需要上google、github等外網(wǎng)的問題
3 其他
命令行美化
sudo apt install zsh
#接下來自行安裝oh-my-zsh,官網(wǎng)的腳本需要代理才能下載
cd ~
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
#自動補(bǔ)全
#自動補(bǔ)全目前在windows的vscode的命令行中有bug瘸恼,長按退格鍵刪除命令時字符顯示會錯位劣挫,至今未修復(fù)(2021-12-14)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sudo vim ~/.zshrc #在 plugins=(git)下方添加 plugins=(zsh-autosuggestions)
source ~/.zshrc
自動補(bǔ)全效果: