Tips

Some tips that may help

Shortcuts in the Preferences Window

You can use Ctlr+D, Ctrl+R and Ctrl+S for “Default”, “Reset” and “Apply” respectively.

You can use Ctlr+Tab and Ctlr+Shift+Tab to go through the preferences pages.

Editor Shortcuts

Besides the shortcuts in the menu, you can use the Read-only Key Bindings and the Editing Key Bindings. There are also some hidden shortcuts: Tab (when there’s a selection) and Shift+Tab for indent and unindent, Ctrl+Enter and Ctrl+Shift+Enter for inserting line after and before, Shift+Delete for deleting the current line.

Drag and Drop

You can drag files and drop them into the main editor or the input/expected part of test cases.

Tabs

You can use Ctrl+Tab and Ctrl+Shift+Tab to switch to the next/previous tab.

You can right-click on the tabs to get a useful context menu. The content of the menu is based on whether this tab is untitled or not, has problem URL or not, etc.

Test Cases

Testlib checkers are compiled when changing the checker or changing the preferences, so you may have to wait for it after the execution is finished.

You can load test cases from files, edit testcases in bigger windows and save a test case in a file in the right-click menu of the test cases.

You can click the verdict to open the diff viewer.

View mode

The view mode is helpful to focus on your codes, investigate the outputs and errors, or make the editor narrower so that you can split your screen into two parts.

You can set a hotkey for switching view modes in Preferences.

Launch CP Editor in the command line

CP Editor supports some command-line options, run cpeditor --help for more information.

On Windows, it’s better to use UNIX-like shells like git bash.

In the command line, you can open a non-existing file as a tab by cpeditor <path> (and you can save to this path later), open all C++ files in a directory recursively by cpeditor --cpp <directory> or temporarily disable Restore last session at startup by cpeditor --no-hot-exit.

CP Editor normally closes when receiving SIGINT and SIGHUP, so if you start CP Editor in the command line, you can safely press Ctrl+C to quit.


Last modified September 25, 2020: feat(docs): add Tips (#60) (946abec3)