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
Please try with latest stable 5.7.1-stable, if you still have that issue take a minute and open issue on GitHub. https://github.com/coder3101/cp-editor
Also please let me know the competitive companion version and the browser you are using.
Also try parsing some other problem or contest.
I raises an issue and also attached image there, please look over that once
still facing same problem in version 5.7.1 stable
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.
Your rating graph is interesting by the way
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 dont know why this happens in cp editor please suggest something anyone. Thank you in advance. This the code for UVa 369.
These are two images one of cp editor, cp editor shows output as limit exceeded and other of geany. ..)
runs into infinite loop. Please either remove it or run by Actions -> Run Detached.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?
This issue is related to CF tools. Recently Codeforces was down and after it came up, this issue is coming for all users. Wait for reply from CF tool author or ask him on his Codeforces Post.
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?
It is not possible but if you wish to have that feature, you can open an issue on our GitHub repository and it will be added. It is easy to add maybe you can also contribute to it.
No, there is already a issue open for customisation of Header comments or completely turning it off.
We do not plan to support only CF tool, rather we want to make it generic so you can use any other tool like OJ Tool. As for placeholder the same above point is valid, we will be adding customisation for header comments with placeholders like %date% %time% and other tokens.
Custom background theme, is also in our roadmap but has low priority. We have made it native in looks and feels. Electron apps like VSCode are fancy looking but not as fast as native apps.
If you save a file, the testcases are saved in the same directory as source (If this feature is on in settings). If you used untitled tab, everything is stored in Temporary directory which gets deleted after each reboot automatically.
https://github.com/coeditor/cpeditor
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.
I really appreciate this project and I am looking forward to use it, but will there be a vim addon that we can use to use vim keybindings with the editor?
Adding vim Emulation is in our roadmap. It will be added after we add some more important features. I myself am a VIM user and miss this feature in our Editor.
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
Can not match any template..how to solve this issue ???
FullScreen Mode ??
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?
feature request : please add autocomplete feature.
I don't know why but whenever I run my code for the first time after compilation, it gives me TLE, and then running it again gives the actual results. Other than that everything works pretty well.
5.7 Now it ask other suffix. Keep it empty_
source of this error from CF-tool repo : (https://github.com/xalanq/cf-tool/blob/master/cmd/cmd.go)
line : 106
trying with some dummy instead of keeping it empty works.
Thanks for this information.
I have updated the blog
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?
Yes, watch this video https://youtu.be/IVx1rSqYz7c
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.
Could you please open these as feature request issues on our github at https://github.com/cpeditor/cpeditor
snapdragon3101 can you please make a youtube video to show the full setup in windows. i guess many people like me are facing difficulties to have a proper setup. So I request you to please provide a setup video from beginning, installing cpeditor, competitive companion and setup of everything. It would be better for the community.
There is already a youtube channel for CP Editor where it has some setup instructions and introduction. https://youtube.com/channel/UCy9_tjBAY78JutntvBtqC6A
We believe firstly we should have well written and detailed wiki/doc on our website, then anyone who is willing to contribute can upload videos on youtube for others to help.
The video is for setup of competitive companion by the way.
does competitive companion work only during contest? cant we use it normally while solving practice problems? I am saying this because now i want to use competitive companion and whenever i use that parse option i ain't getting any valid parsing option?
It works on any problem, even practice problem. If it does not works somewhere, please ask it to competitive companion creator or leave your review on its page.
fixed now. Thanks
Hello thanks for Cp Editor For me Compile and run works but when I click on submit button then it shows Error: C:/Users/scope/AppData/Local/Temp/CP Editor-sgymLw/sol.cpp can not match any template. You could add a new template by
cf config
How to resolve this error????The error is pretty self explaining.
But I already add a template with above mentioned steps
snapdragon3101 I use python for coding but in cpeditor I face one problem and that is of ide. There aren't any features like autocompletetion of code or syntax suggestion , error detection or automatic tab after every block. And in python it is very necessary. I mean it is not possible to press tab for indentation after every line. so I want to ask if something like that exists in cpeditor so that I can make it possible? if not how can I add it or it is not possible. Thanks
There is error highlighting, actually Python is not our primary language to test so we could have missed those things, but as far as I remember there is an issue on GitHub for indent problem. There is error highlighting for that you need to setup LSP. Auto complete is in our future goals.
It means whatever i mentioned will be added and is not present at moment? what is LSP tho?
Please read a section relevant to you. https://cpeditor.org/docs/setup/#setup-language-server