Windows 系统相关配置

powershell 7

安装

1
2
winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell.Preview --source winget

在 store 安装 terminal preview

将 powershell 7(pwsh) 设置为默认

键盘配置

image

PowerToys

image

image

使用 WSL 方案

Terminal

设置默认终端为 wsl 的 ubuntu

直接在 terminal 的 setting json 中找到对应 uuid 填入

在终端开启代理

1
2
3
cd ~
touch openproxy.sh
vim openproxy.sh

填入下面内容

1
2
3
4
export http_proxy="http://127.0.0.1:10887"
export https_proxy="http://127.0.0.1:10887"

echo "already open proxy with 127.0.0.1:10887

127.0.0.1 如果是在虚拟机,需要填入vpn开启的 ip 地址

1
2
touch closeproxy.sh
vim closeproxy.sh

填入

1
2
3
4
unset http_proxy
unset https_proxy

echo "already close proxy"

添加别名,在 .bashrc .zshrc 你使用的终端添加

1
vim .bashrc

加入

1
2
alias openproxy="source ~/.command/openproxy.sh"
alias closeproxy="source ~/.command/closeproxy.sh"

也可以直接

.zshrc

1
2
alias openproxy="export http_proxy='http://192.168.0.103:21882'; export https_proxy='http://192.168.0.103:21882'"
alias closeproxy="unset http_proxy; unset https_proxy"

使用方法

1
2
3
4
# 开启
openproxy
# 关闭
closeproxy

安装 zsh

1
2
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

zplun 用于安装插件

1
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
1
2
3
4
5
6
7
8
9
10
11
12
source ~/.zplug/init.zsh

zplug "zsh-users/zsh-syntax-highlighting", defer:2

if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi

zplug load --verbose

编辑 .zshrc 文件,参考

sudo apt install cowsay

安装 nvm

1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | zsh

使用 Git Bash 方案

安装 Windows 包管理工具,打开 powershell 非管理员模式

1
2
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex

安装常用包

1
2
3
4
5
6
# lazygit
scoop bucket add extras
scoop install lazygit

# neofetch
scoop install neofetch