使用 Quick Olympic Coding 插件为竞技编程(C++)设置 Sublime Text
使用快速奥林匹克编码插件为竞争性编程(C++)设置Sublime Text
查看讨论
改进文章
保存文章
喜欢文章
-
最后更新 : 2022年9月12日
-
阅读
-
讨论
竞争性编程是一项智力运动,时间是最重要的。为此,需要一个快速和易于使用的工具来编写代码。Sublime text与CppFastOlympicCoding 插件一起提供了同样的功能。Sublime text因其快速的性能和美观的用户界面而受欢迎。CppFastOlympicCoding插件提供了以下功能。
- 测试管理器。 在测试管理器的帮助下,我们可以轻松添加、编辑和删除测试。
- StressTesting。 StressTesting意味着我们可以测试我们的程序,找到它不工作的测试。
- CppLint。 我们可以在设置中编辑Cpplint的属性。
- 调试器。 它为OSX提供调试功能。
- 类的补全。 对于模板的替换,将字符写成类。
- 竞赛设置。 它是专门为竞争性编程设计的。
在这篇文章中,我们将了解到如何使用快速奥林匹克编码插件轻松设置Sublime text For Competitive Programming。如果你想下载和安装sublime text,请参考这篇文章------。 如何在Windows中安装Sublime Text3?.
要下载最新版本的Sublime Text 4,请访问链接,然后在本地机器上安装.exe文件。
下载和安装Mingw编译器
要下载Mingw编译器,请访问其官方 链接。
第1步:下载MinGW的设置
第2步: 标记mingw32-base和 **mingw32-gcc-g++**软件包进行安装,然后更新目录。
设置Sublime Text
第1步: 在sublime text中选择工具选项或使用 Ctrl+Shift+P(针对windows用户)打开命令托盘
第2步: 输入 Install package control来安装sublime text的软件包控制器。该软件包控制器有助于为sublime text下载不同的软件包。
第3步: 输入软件包控制器。在命令栏中安装软件包,并搜索C++ & C Single File Builder - Minghang Yang 软件包。
第4步: 安装后,选择构建系统为C++ Builder Minghang Yang。
第5步: 现在你可以使用Ctrl+B 命令运行一个C++程序**。** 要了解更多关于安装和设置Fast Olympic Coding插件的信息,请参考这个链接。
CppFastOlymicCoding是一个强大的sublime插件,适用于竞争性程序员。它包括的功能有:测试管理器,C++ linter CppLint,类完成,调试器和压力测试。关于它的功能和键绑定的信息,请访问 链接.
- 第一步:输入Package Control。 在命令托盘中安装包 ,搜索并安装Jatana的CppFastOlympicCoding 。
- 第2步: 使用快速奥林匹克编码构建和运行,使用按键绑定**(Ctrl+Alt+B**)。
- 第3步: 如果每次编译代码时输入/测试案例都会丢失,请在CppFastOlympicCoding的用户设置中粘贴以下内容。要打开用户设置,输入CppFastOlympicCoding。在命令栏中打开设置。
C
{
// enable/disable lint
"lint_enabled": true,
// lint style properties
"lint_error_region_scope": "invalid.illegal",
// "lint_error_region_scope": "variable.c++",
"lint_warning_region_scope": "constant",
"algorithms_base": null,
"tests_file_suffix": "__tests",
// run settings:
// "{file}": file name
// "{source_file}": relative path to file
// "{source_file_dir}": relative path to file directory
// "{file_name}": file basename
"run_settings": [
{
"name": "C++",
"extensions": ["cpp"],
"compile_cmd": "g++ \"{source_file}\" -std=c++11 -o \"{file_name}\"",
"run_cmd": "\"{source_file_dir}\\{file_name}.exe\" {args} -debug",
"lint_compile_cmd": "g++ -std=gnu++11 \"{source_file}\" -I \"{source_file_dir}\""
},
{
"name": "Python",
"extensions": ["py"],
"compile_cmd": null,
"run_cmd": "python \"{source_file}\""
},
{
"name": "Java",
"extensions": ["java"],
"compile_cmd": "javac -J-Dfile.encoding=utf8 -d \"{source_file_dir}\" \"{source_file}\"",
"run_cmd": "java -classpath \"{source_file_dir}\" \"{file_name}\""
}
],
// time limit for stress
"stress_time_limit_seconds": 2,
// enable/disable complete
"cpp_complete_enabled": true,
// class completion settings
"cpp_complete_settings": {
"classes": {
"int": {
"template_size": 0,
},
"char": {
"template_size": 0
},
"string": {
"template_size": 0,
},
"pair": {
"template_size": 2,
},
"vector": {
"template_size": 1
},
"bool": {
"template_size": 0
},
"ll": {
"template_size": 0
},
"double": {
"template_size": 0
},
"set": {
"template_size": 1,
"bind": "S"
},
"map": {
"template_size": 2
}
},
"dont_expand": [
"pii"
]
},
// closing sidebar when executing
"close_sidebar": true
}