snapdragon3101's blog

By snapdragon3101, 14 months ago, In English

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 setup cf-tools. Please note the submit button will be only visible in the editor if the problem was parsed by Competitive Companion from code-forces.
Installation and setup of cf-tool

  • 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.

 
 
 
 
  • Vote: I like it
  • +131
  • Vote: I do not like it

»
14 months ago, # |
  Vote: I like it +38 Vote: I do not like it

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.

  • »
    »
    14 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    One of those times where the like button for a comment is not enough.

  • »
    »
    14 months ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    I will always welcome contributions to the work. Together we can build an editor for ourselves.

»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Your extension will have it’s own codeforces soon :D

»
13 months ago, # |
Rev. 4   Vote: I like it +4 Vote: I do not like it

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.

Latest Stable Latest Release

screenshot

  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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?

    • »
      »
      »
      13 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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.

      • »
        »
        »
        »
        13 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        You can use Competitve Companion to parse a contest.

        • »
          »
          »
          »
          »
          13 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          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.

          • »
            »
            »
            »
            »
            »
            13 months ago, # ^ |
            Rev. 4   Vote: I like it 0 Vote: I do not like it

            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".

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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?

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can set the path of CF Tool in the preferences (Options→Preferences→Extras→Misc→CF Tool Command), just like the "error" said.

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

will it work on linux

  • »
    »
    11 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    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.

»
11 months ago, # |
Rev. 2   Vote: I like it +9 Vote: I do not like it

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

»
11 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Can it be used to submit on other online judges? If so, please tell me how.

  • »
    »
    10 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It will expand to submission on other judges who support submission via HTTPS API like Atcoder and Some other. So wait

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can you make a mode which is all dark instead of only the code is dark?

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    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.

    • »
      »
      »
      10 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Can this work on the previous version (I think 6.2.4)?

      • »
        »
        »
        »
        10 months ago, # ^ |
          Vote: I like it +2 Vote: I do not like it

        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

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Would someone please tell me how can I append -std=c++11 to my compile command!

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Java users -> class name of main class must be "a"

  • »
    »
    7 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can use a public class with any name you want since 6.6.1.

»
9 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

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. ![ ](https://www.imageupload.net/image/Yg3xq

  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    while(scanf("....")..) runs into infinite loop. Please either remove it or run by Actions -> Run Detached.

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
8 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

When I tried to submit then it print "cannot find csrf".

How can I solve this issue?

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

»
7 months ago, # |
Rev. 5   Vote: I like it +3 Vote: I do not like it
  1. Thanks snapdragon3101 for the awesome editor.
  2. I have a few questions regarding this -
  • Is it possible to change color of the messages shown in console? I want all of it to be in white, I find red color irritating and by default all the variables printed in cerr are shown red in console.
  • Can I remove/switch off the auto addition of first 6 lines in the template i.e. problem name, contest, time limit etc ?
  • How can I add the placeholder of cf-tool into template ? I could not find any tutorial regarding this.
  • How can I add a custom background theme? Or can you share the path where theme files are stored on linux so I can change background color manually?

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?

  • »
    »
    7 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it
    • 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

  • »
    »
    7 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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?

  • »
    »
    7 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    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.

»
7 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yeah...it happened for me too but only in gym section not in problem set or during contests

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can not match any template..how to solve this issue ???

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

FullScreen Mode ??

»
6 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    6 months ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    This is a command line app, so it must be invoked from the terminal.

    Try doing the following

    > cd Your\Path\to\CF\
    > .\cf.exe
    

    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.

»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can you add option of IO in left and Editor in right. And option of vertical splitting of IO and Editor.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

feature request : please add autocomplete feature.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How do I load a particular template everytime I open a new problem? Currently, what opens up is a file with a few comments

»
7 weeks ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

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..

//Problem: F. 1 2 3 4 ...
// Contest: Codeforces — Codeforces Round #696 (Div. 2)
// URL: https://codeforces.com/contest/1474/problem/F
// Memory Limit: 256 MB
// Time Limit: 5000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

What to do now?

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

feature request : please add autocomplete feature.

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

5.7 Now it ask other suffix. Keep it empty_

if I keep it empty  cp-editor arise this error :
log details : 

[ MessageLogger.cpp  ](72)::MessageLogger Information <head>: [CF Tool], <body>: [/tmp/CP Editor-VeyRYX/sol.cpp can not match any template. You could add a new template by `cf config`

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.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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....

Error Picture
  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You have created two templates in CF for C++. Please delete one of them.

    • »
      »
      »
      4 weeks ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      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....

      Picture
»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there a way to parse all tasks of a contest at once into cp editor instead of opening each problem and parse it?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi. Could you implement the following features? Thanks in advance.

  1. Custom keybinding for Detached Run (if possible, other editor functionalities too).

  2. 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?

  3. Detached Run without compiling, only running the executable in the terminal window.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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?

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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????

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The error is pretty self explaining.

        • »
          »
          »
          »
          »
          4 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          But I already add a template with above mentioned steps

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.