- 分享日常
配置环境脚本 + setting.json + cpp.json
- 2025-3-5 15:24:50 @
脚本
NJTC机房专用
setx PATH "%PATH%;C:\Program Files (x86)\Dev-Cpp\MinGW64\bin" /M
通用(默认MinGW64安装在C盘)
@echo off
set "MINGW_BIN=C:\msys64\mingw64\bin"
echo %PATH% | findstr /I /C:"%MINGW_BIN%" > nul
if %errorlevel% equ 0 (echo MinGW-w64 bin目录已在 PATH 中,无需重复添加.)
else (setx PATH "%PATH%;%MINGW_BIN%" /M
echo MinGW-w64 bin 目录已添加到PATH
)
setting.json
"files.autoSave": "afterDelay", //文件自动保存
"files.autoGuessEncoding": true,
"editor.cursorBlinking": "smooth",//控制光标样式,这个是 '|' 闪烁
"editor.mouseWheelZoom": true, //鼠标滚轮控制字体大小
"editor.wordWrap": "on", //代码超过编译器范围自动折行
"workbench.list.smoothScrolling": true, //控制列表和树的平滑滚动效果
// "editor.cursorSmoothCaretAnimation": "on", //丝滑的光标移动和代码弹出,但太丝滑
"editor.smoothScrolling": true, //上下滚动补帧,更平滑
"editor.bracketPairColorization.enabled": true,
"editor.suggestSelection": "recentlyUsed",
//代码提示时优先第一个选择上一次用过的,比如q.push,下次打出q.的时候第一个候选是push
// "editor.formatOnPaste": true,
// //控制编辑器是否自动格式化粘贴的内容。格式化程序必须可用,并且能针对文档中的某一范围进行格式化
// "editor.formatOnType": true,
// //控制编辑器在键入一行后是否自动格式化该行。
// "editor.formatOnSave": true,
// //在保存时格式化文件。格式化程序必须可用,延迟后文件不能保存,并且编辑器不能关闭。
"cph.language.cpp.Args": "-Wmaybe-uninitialized -std=c++14 -O2", // -O2优化
"cph.language.cpp.SubmissionCompiler": "GNU G++23 14.2 (64 bit, msys2)", //比较高的g++标准
"c-cpp-compile-run.cpp-flags": "-Wmaybe-uninitialized -std=c++17 -O2", //同上
"c-cpp-compile-run.run-in-external-terminal": true, //运行终端时弹出窗口
代码片段
"c++ older代码片段": {
"prefix": "`q",
"body": [
"#include <bits/stdc++.h>",
"#define int long long",
"#define INF 0x3f3f3f3f",
"#define PII pair<int, int>",
"#define ULL unsigned long long",
"#define PIII tuple<int, int, int>",
"#define all(v) v.begin(), v.end()",
"#define debug(a) cout << #a << \" = \" << a << endl;",
"using namespace std;",
"constexpr int N = 1 * 1e6 + 10, M = 5 * 1e3 + 10;",
"",
"",
"void solve() {",
" $0",
"}",
"",
"signed main() {",
" ios::sync_with_stdio(0); cin.tie(nullptr), cout.tie(nullptr);",
" int _ = 1;",
" // cin >> _;",
" while (_--) {",
" solve();",
" }",
" return 0;",
"}",
"",
"/**",
" * description: C++17 Algorithm Template for Competitive Programming",
" */"
],
"description": ""
}
1 条评论
-
xfxcy 可爱捏! LV 8 SU @ 2025-3-10 13:13:52
你好, 我是xfx
🤡 1
- 1