Check : https://cpeditor.org
Hi Guys!
CP Editor met Competitive Companion in 3.0, giving it the ability to parse contests from over 30+ online competitive programming websites. Now, with CP Editor 5.0, it met CF tools, a wonderful tool by xalanq which can do all most everything in code-forces, even submit solutions. Read more about CF tools in his blog.
If you are a pro-user and like vim keybindings, using cf-tools on your favorite terminal with tmux would give your more than what CP Editor has to offer but at the same time, it is very time consuming and difficult to setup on windows.
Let's dive into what is new for us in CP Editor 5.0
- Submit solution to Codeforces from CP Editor, you don't need to copy or upload your solutions manually. Let CP Editor do it for you with just one button click. This feature requires that you have
cf-tools
installed and you have correctly configured cf-tools. Read the instructions below on how to install and setupcf-tools
. Please note the submit button will be only visible in the editor if the problem was parsed by Competitive Companion from code-forces.
- Set up snippets of codes like Sublime Text, You can add as many snippets as you want in all 3 officially supported languages in CP Editor. You can set up hotkeys for triggering snippets and then search for your snippets and paste it into text editor. You can even rename snippets. Snippets are language defined, you won't find C++ Snippets when your Tab language is set to Python. All snippets are stored inside cp_editor_settings.ini file, which is located in your home directory and contains all the settings of CP Editor. This also, portable and platform independent. In order to inspect it, you can open it like any normal text file.
Big Thanks to ouuan for his work in making snippets available.
View Modes: CP Editor now has 3 view modes, in Editor mode the complete window of the application will be occupied with Code Editor, in IO Mode complete window will be occupied by Input output boxes and normal mode is called Split Mode, in which window is shared between the two. You can even set hotkeys to toggle the views from Preferences for a quick change of view modes.
You now have ability to just apply settings. There are three options, "Okay", "Apply" and "Cancel", Okay will close the window and settings will be applied and Apply will keep the preference window open while settings are applied and Cancel will close the preference window.
There are many other bug fixes and quality of experience improvements. There are some performance improvements too.
Download
Sources : https://github.com/cpeditor/cpeditor
Download : https://github.com/cpeditor/cpeditor/releases
Support
- Star the project and spread the word about this editor.
- else you can open Editor and Help -> Support me, to buy me a coffee
I will be busy with my new semester and also with Google Summer of Code 2020, Hence pace of development will slow down a bit for this project starting today.
Telegram group for community
Please join our telegram group https://t.me/cpeditor
You have can discuss, share your views and get helped or help other there.
If you found any bugs or have any feature requests, please open an issue here, and don't forget to follow the issue templates. Users' responses are important for contributors to improve the project.
If you want a try on developing, you can install Qt and CMake, then fix bugs / make new features by yourself! After finishing the coding, just open a pull request here. Don't worry if you are not familiar with Qt / GUI programming, Google is your friend, and Qt is a well documented library. I've never used Qt before contributing to CP Editor, but I've made 33 commits, including 1979 additions and 1620 deletions up to now.
One of those times where the like button for a comment is not enough.
I will always welcome contributions to the work. Together we can build an editor for ourselves.
Your extension will have it’s own codeforces soon :D
There have been many new features since 5.0:
New Test Cases UI. Now you can open up to 100 test cases or delete some of them. It's also easier to add tests from files.
New Diff Viewer. The new diff viewer uses diff-match-patch, so that you can see the beautiful diff result in HTML.
New File Logic. Now the tab status/open files/save files are almost the same as Sublime. For example, external file changes on the disk is detected.
Hot Exit. Now you can save the status for the next session.
Transparency Setting. You can set the transparency for the editor. Then, you can see the problem statement/your desktop/some pictures while coding, or just be cool.
Single Application. Now when you open a new file while there is a CP Editor running, the new file will be opened in a new tab instead of a new window.
Open Contests. You can open a folder with
A.cpp
,B.cpp
, ...,Z.cpp
easily. The folder and the number of files (number of problems) is chosen by you.Command-Line Options. See
CPEditor --help
for more information. Now it's easier to open CP Editor from the command line.Open File Progress Bar. Show progress bar for file opening.
Tab Bar Context Menu. A menu with options like Close Others/Reveal in Explorer. Right-click on the tab bar to open it.
Many bug fixes.
Some features are not well-tested yet, if you are interested in them, try it and report bugs if you find any.
Again, contributions are always welcomed, together we can build a better editor for ourselves.
When we open contest and create 'n' files,and after that when we parse tasks from contest do the test cases(of the corresponding problem) get updated or new tabs come up?
I checked it now,its not updating rather creating new tabs. It would be better if just the test cases would have got updated so that we can directly save our code and submit.
You can use Competitve Companion to parse a contest.
Yes,but what I meant to say is when we parse contest,it would be better to just update the test cases of the created contest in cp-editor than creating more new tabs.
The basic idea of this feature is that you can save directly without choosing where to save.
If you want new features, open issues on Github.
UPD: I didn't read his comment carefully so I didn't realize he is talking about parsing a contest after "Open Contest".
When I press ctrl+shift+U on contest dashboard, I got [an invalid Payload was delivered on the listening port] in CP-editor, How can I resolve this?
What does this shortcut does. Press Green plus icon on contest dashboard.
Got same error even on pressing green icon.
Which version of editor? See Help->About
5.8.3
5.8.3 is beta and not tested release.
But the competitive companion part is nearly the same.
Did the same as mentioned in above procedure but getting the error as -
[You will not be able to submit code to Codeforces because CFTools is not installed or is not on SYSTEM PATH. You can set it manually in settings.]
Can anyone help me with the solution for this problem!!
Thanking You in advance.
You can set the path of CF Tool in the preferences (Options→Preferences→Extras→Misc→CF Tool Command), just like the "error" said.
will it work on linux
hey, yes it does work on Linux; if you follow the link given at the beginning of the post (https://cpeditor.github.io/), there is an option to download it directly on the main page. (Button "Get for Linux", or something like that, when you browse the site from a Linux machine.)
I am using the tool on Linux too, and can only recommend it.
Are you doing cp for 8 years?
I did everything as above and it worked well but i still don't know how to submit what should i do to submit a problem.
Edit: never mind i found out how to do it now
Can it be used to submit on other online judges? If so, please tell me how.
It will expand to submission on other judges who support submission via HTTPS API like Atcoder and Some other. So wait
I think it's more possible that custom submit command will be added instead of directly sending HTTPS requests in CP Editor.
Can you make a mode which is all dark instead of only the code is dark?
If you use Windows 10, starting CP Editor 6.3.1 (current Beta version), if you enable "Dark mode for Apps" in Windows 10 Settings and use our Editor, It will use full dark theme.
If you use macOS 10.14.5+ Turning dark mode on from System Settings will make Editor dark as well.
If you use Linux distributions like KDE, using any dark theme from system Settings will make Editor Dark.
Can this work on the previous version (I think 6.2.4)?
If it was added in 6.3.1 how can it work on old version?
For Linux and macOS it will work for any version of CP Editor but for windows at least 6.3.1
Would someone please tell me how can I append -std=c++11 to my compile command!
Options->Preference->Languages->C++ compile command
still, it doesn't work.
Java users -> class name of main class must be "a"
You can use a public class with any name you want since 6.6.1.
I followed the above-mentioned steps for the setup of cf-tools. But when I run the command cf test, it gives an error
Runtime Error #1 ... exec: "dummy": executable file not found in %PATH%
.Rest of the commands like cf gen, cf list, cf submit, cf stand are working fine.
Please help.
When I tried to submit then it print "cannot find csrf".
How can I solve this issue?
Also, I want to know whether the test cases parsed by competitive companion are stored permanently on system and if so then what is the location so I can delete it manually?
You can choose to save test cases on your disk or not (Actions->Save->Save Test Cases), and you can also set where to save test cases in the settings (File Path->Test Cases).
There are many settings, but the documentation is still under construction. If you want the best experience in the future, you can go through all settings, read their tooltips, and configure them.
How to get the test cases preloaded when I save and open a file in cp editor
I'm not sure what you mean. But if you want to have the test cases after closing and reopening a file, you can enable Actions/Save Testcases On Save in Preferences.
snapdragon3101 When I submit code from the editor, few lines goes out of indentation automatically, like in this submission, the 3rd and 4th line of main() function is out of indent, also, the tab width becomes too large in codeforces automatically(I guess approx 8), although in editor tab width is set to 3. Can you please fix this.
Also, in every live contest, when I parse problem-A using competitive companion, the new file is created with name — "0" instead of "A" and with wrong URL(therefore I cannot submit it from the editor), don't know whether the bug is in parser or cpeditor. Can you please look into this.
Yeah...it happened for me too but only in gym section not in problem set or during contests
I have downloaded it and setup as per said those 7 steps...and also restarted my device. But now when i try to run cf.exe it just appears a window and just gone in a second. Maybe something preventing the exe file to run. I turned off windows defender but doesn't change the situation. I also have competitive companion on my chrome.
This is a command line app, so it must be invoked from the terminal.
Try doing the following
where
>
represents the command prompt. You should not enter them as a part of the command.To start the command prompt, you can press Windows+R then type
cmd
.Thanks i have done it already..
can you add option of IO in left and Editor in right. And option of vertical splitting of IO and Editor.
feature request : please add autocomplete feature.
How do I load a particular template everytime I open a new problem? Currently, what opens up is a file with a few comments
please say how to get the template file? What I have done is- 1)setup the cf-tool and added template to it 2)also added cf-tool to my path But when i click on Competitive Companion in browser what i get in cp-editor are only few comments like these..
What to do now?
Whenever I try to submit to codeforces CP editor is asking me to select language. PS: I have manually set CF tools through preferences. Anyone please help me out in this....
You have created two templates in CF for C++. Please delete one of them.
How to delete, I have set 1 template from preferences and no template left when I deleted that one.
Update: It is solved now , Thanks....
Is there a way to parse all tasks of a contest at once into cp editor instead of opening each problem and parse it?
Hi. Could you implement the following features? Thanks in advance.
Custom keybinding for Detached Run (if possible, other editor functionalities too).
When I press
Shift
+Home
, all the characters before the cursor will be selected, including the tab/space for the indentation. Can you fix it so only the characters after the indent are selected?Detached Run without compiling, only running the executable in the terminal window.
What should I do if I want to use c++ 64 bit features like using __int128 ? It gives error if I use __int128 currently.
Hey buddy, you can refer this.
Is it possible to have the author's name and the current time (the placeholders like in the cf-tool) in the template? Right now, if I set up the template with the placeholders in the cf-tool, it won't work.
dose it work for mac ?
how to enable Hinting on CP Editor?
Hi, sorry for necroposting, but is anyone able to increase font size above the default? I tried a lot from preferences but it doesn't seem to increase :/
decided to try it for the first time and and saw a mind-blowing thing: pressign home button sends cursor to start of line ignoring tabulation
When adding template absolute path it says its invalid, pls help!
whenever i try to login on cf config it says "cannot find csrf" ....can someone help? also, where can i find the 'cf config' file on macOS?
/
same issue .. i cannot type the password ouuan
Did you find any solution ?