CP Editor is a Native Qt based code editor writter in C++. It make you only focus on your code and automates the compilation, executing and testing. It even fetches testcases for you from web!
Head over to the release page and download the binary/installer depending upon your OS.
-
Windows users can find an
Installerinstall it and start to code. -
Linux users can find an
AppImageinstall or directly run it.Google on how to run App Images.
-
Mac users please install from source for the time being.
For Chinese users who are not convenient to download on Github, there is an alternative download link (it's not guaranteed to be up to date).
- By default the editor uses
g++as compiler. You can change your compiler command to change the way editor will compile your code (Settings => Compile Command). Any compiler of your choice will work as long as its added to PATH and works.
Do not use
-ooption while changing compile command. Let editor itself generate the executable name.
- To use
code-formatyou need to haveclang-format(recommended) installed and added to PATH. If you want to use something else you can use, If you don't want to use code-format then ignore the Formatter Error.
Any Error if occurs will be reported in
Message Section. Try to read it and mitigate if possible. In most cases it will be related with your compiler or things not in PATH.
-
Since Python is interpreted language, we will need to change
Run Command. By default it is empty, From Settings => Run Command, set it topython. Make sure Python is in PATH and is working. If newly added to PATH, A reboot may be needed for Editor to recognize it. -
Now Change Editor Language to Python. From Editor => Language => [Check] Python. This will enable Python syntax Highlighting and keyword completer.
-
Now, start typing your wonderful code. Make sure you always use "Compile and Run", "Run" uses buffered script.
-
Assuming that you have
javacandjavato your PATH, Enable Editor to use Java by Enabling Editor => Language => [Check] Java. -
Now change the Compile command to something like
javac -
Now Change Run Command to
java -
Now start to code.
You must not make your Java class public or give any other name apart from
a.
| Shortcut | Description |
|---|---|
| CTRL+N | Launches a new Session and resets the editor. Once you solved a problem you need to Launch a new Session for the next Problem. |
| CTRL+Q | Quit and Exit Application |
| CTRL+O | Opens a new Source File into Editor |
| CTRL+S | Saves the current content of editor to a File |
| CTRL+Shift+S | Saves as |
| CTRL+Alt+L | Formats the editor using format_command |
| CTRL+Shift+R | Compile and Run |
| CTRL+Shift+C | Compile only |
| CTRL+R | Run |
| CTRL+K | Kill all running Test cases / Samples |
| CTRL+Shift+D | Run the program in separate window (Detached mode) |
To use these keys, enable Hotkeys from Settings => [check] Enable Hotkeys
| Key | Action |
|---|---|
F5 |
Compile | Equivalent to CTRL+Shift+C |
F6 |
Compile and Run | Equivalent to CTRL+Shift+R |
F7 |
Run only | Equivalent to CTRL+R |
F9 |
Detached Execution | Equivalent to CTRL+Shift+D |
F11 |
Kill | Equivalent to CTRL+K |
These keys cannot be changed manually, so get used to them!
Qt must be installed in order to compile from source
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ cmake --build .Contributors and contributions are welcomed! However to maintain the quality of code, we use Coding Style. So make sure that your changes are formatted using clang-format, using the format-file provided in the root of the directory.
- Where does the editor saves my code and binary executable?
- Editor does not saves your files if you don't Save them yourself. You can find your binary executable at
C://Users/<NAME>/AppData/Local/Temp/a.exein windows and on NIX in/tmp/a.out. At those location the source file could also be located with namesol.cpp.
- Editor does not saves your files if you don't Save them yourself. You can find your binary executable at
- I am using it in Java and editor is not working.
- Make sure
javaandjavacare in PATH variables. Please Log/Restart your machine if it does not recognizes the Java Compiler. Now make sure your source code has non-public class named a.
- Make sure
- I get DLL Missing error while launching application?