开发环境配置
Scoop 安装(Windows 必装)
Scoop 是 Windows 下的命令行包管理器。
打开 PowerShell(建议以管理员身份运行),设置执行策略:
powershellSet-ExecutionPolicy RemoteSigned -Scope CurrentUser安装 Scoop:
powershellInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression添加必要 bucket:
powershellscoop bucket add main scoop bucket add extras scoop bucket add versions scoop bucket add java
Git
安装
Windows
powershell
scoop install gitArch Linux
bash
sudo pacman -S git配置信息
设置用户名,建议与 GitHub 用户名一致:
bashgit config --global user.name "[用户名]"设置邮箱,建议与 GitHub 邮箱一致:
bashgit config --global user.email "[邮箱]"设置默认分支为
main:bashgit config --global init.defaultBranch main配置全局代理(可选):
bashgit config --global http.proxy "http://127.0.0.1:30000" git config --global https.proxy "http://127.0.0.1:30000"
C/C++
安装
Windows
powershell
scoop install gccArch Linux
bash
sudo pacman -S base-devel与 VS Code 集成
不使用 VS Code 官方 C/C++ 扩展,推荐使用 Clangd(更强的静态分析)。
安装 VS Code
安装扩展:
clangd、Code Runner安装 Clangd 本体
- Windowspowershell
scoop install clangd - Arch Linuxbash
sudo pacman -S clangd
- Windows
开启
code-runner的runInTerminal设置修改
executorMap中cpp配置:cd $dir && g++ $fileName -std=c++14 -O2 -o $fileNameWithoutExt && $dir$fileNameWithoutExt点击 cpp 文件右上角的
Run Code按钮运行
检查安装
bash
gcc --version有输出即为安装成功
Python
使用 uv 作为包管理器(比官方 pip 更快、更易管理)
安装
Windows
powershell
scoop install uv
uv python installArch Linux
bash
sudo pacman -S uv配置 UV 镜像源
Windows
powershell
mkdir -p ~/.config/uv
echo @"
[registries.tuna]
index = "https://pypi.tuna.tsinghua.edu.cn/simple/"
"@ > ~/.config/uv/config.tomlArch Linux
bash
mkdir -p ~/.config/uv && echo -e '[registries.tuna]\nindex = "https://pypi.tuna.tsinghua.edu.cn/simple/"' > ~/.config/uv/config.toml与 VS Code 集成
安装 VS Code
安装扩展:
python、Code Runner开启
code-runner的runInTerminal设置命令面板 →
Python:选择解释器→ 选择 Scoop Python点击 py 文件右上角的
Run Code按钮运行
检查安装
bash
python --version
uv --version有输出即为安装成功
Rust
安装
Windows
powershell
scoop install rustArch Linux
bash
sudo pacman -S rust配置 Cargo 镜像
Windows
powershell
mkdir -p ~/.cargo
echo @"
[source.crates-io]
replace-with = "mirror"
[source.mirror]
registry = "sparse+https://mirrors.aliyun.com/crates.io-index/"
"@ > ~/.cargo/config.tomlArch Linux
bash
mkdir -p ~/.cargo && echo -e '[source.crates-io]\nreplace-with = "mirror"\n[source.mirror]\nregistry = "sparse+https://mirrors.aliyun.com/crates.io-index/"' > ~/.cargo/config.toml检查安装
bash
rustc --version
cargo --version有输出即为安装成功
与 VS Code 集成
安装 VS Code
安装扩展:
rust-analyzer、Code Runner开启
code-runner的runInTerminal设置点击 rs 文件右上角的
Run Code按钮运行
Node.js
安装
Windows
powershell
scoop install nodejs
scoop install pnpmArch Linux
bash
sudo pacman -S nodejs npm pnpm配置镜像源
bash
npm config set registry https://registry.npmmirror.com
pnpm config set registry https://registry.npmmirror.com检查安装
bash
node --version
npm --version
pnpm --version有输出即为安装成功
Go
安装
Windows
powershell
scoop install goArch Linux
bash
sudo pacman -S go配置镜像源
Windows
powershell
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,directArch Linux
bash
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct检查安装
bash
go version有输出即为安装成功
Java
安装
Windows
powershell
scoop install zulu25-jdkArch Linux
bash
paru -S zulu-25-bin配置环境变量
Windows
在 PowerShell 中运行以下命令:
powershell
[Environment]::SetEnvironmentVariable("JAVA_HOME", "$env:USERPROFILE\scoop\apps\zulu25-jdk\current", "User")
$path = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$path;%JAVA_HOME%\bin", "User")检查安装
bash
java --version
javac --version有输出即为安装成功
Kotlin
Windows
powershell
scoop install kotlinArch Linux
bash
sudo pacman -S kotlin检查安装
bash
kotlin -version有输出即为安装成功