第一步 打开文件->首选项->配置用户代码片段
第二步 点击配置全局代码片段文件
第三步 编写自己的码代码补全
{
// Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
"Print to console": {
"scope": "cpp",
"prefix": "#include<bits/stdc++.h>",
"body": [
"#include <bits/stdc++.h>",
"#define endl '\\n'",
"#define int long long",
"",
"using namespace std;",
"",
"typedef pair<int, int> PII;",
"",
"const int N = 1e5 + 10, M = 2e5 + 10, INF = 0x3f3f3f3f3f3f3f3f;",
"",
"int n, m;",
"int a[N];",
"",
"void solve()",
"{",
" cin >> n >> m;",
"}",
"",
"signed main()",
"{",
" ios::sync_with_stdio(false);",
" cin.tie(nullptr);",
" cout.tie(nullptr);",
"",
" //int T;",
" // cin >> T;",
" //while (T--)",
" solve();",
"",
" return 0;",
"}"
],
"description": "cpp 代码自动补全"
}
}
第四步 保存文件
测试 成功