算法竞赛IDE-CP Editor配置

· · 个人记录

什么是CP-Editor

CP Editor是一款专门为算法竞赛设计的IDE

如何配置

下载

下载CPEditor

顺便安利一个GitHub快速下载网站:

GitHub快速下载

安装就不多说了

进入界面,按下cmd + P进入设置

进入"外观"

可以照着我的设置配置

然后进入语言-C++

命令填这个:

g++ -Wall -std=c++11 -O0

c++后面的数字视你想要的标准而定

-O0是不进行优化,也可以-O2吸氧

括号一定要把这三样打开

代码片段和缺省源类似,可以快速插入一段代码

就像酱紫

然后设置扩展

clang-format 格式化代码

直接brew install clang就有啦

brew 下载脚本: Mac终端执行

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

然后搜索一下clang-format,拷贝路径粘贴在路径框里

然后勾选保存代码设置,看自己情况

配置给一下我的设置吧

# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignOperands: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
  AfterCaseLabel: false
  AfterClass: false
  AfterControlStatement: Never
  AfterEnum: false
  AfterFunction: false
  AfterNamespace: false
  AfterUnion: false
  BeforeCatch: false
  BeforeElse: false
  IndentBraces: false
  SplitEmptyFunction: false
  SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 0
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: ForIndentation

Language Server自动语法纠正

brew install llvm

地址同上自己找

然后提示延迟可以稍微开小一点

神器Competitive Companion

是Chrome插件哦

Competitve Companion

插件安装自行google

配置:

可以增加注释、自动填好样例!

在一道题(或一个cf比赛)上(支持luogu,cf,libre,poj等很多平台)点击chrome右上角长这样的标志即可拉取数据

cf tool-大大大大大codeforces神器

cf-tool下载

解压后将cf放到自己想要的地方,记下路径

回到cpeditor填好路径就可以用啦

可以在编程界面直接评测! 记得把下面显示消息的√勾上

快捷键

按我这个用就可以了

自己看什么意思

使用展示