The Commenter plugin provides a quick way to comment out selected text.
To comment out one or more lines of code, place the cursor anywhere on that line or select the lines you want to comment out (or portions of these). Click on the Commenter button, the selected lines get commented out.
In our example C++ comments were used. The Commenter will choose between those, C-style comments, HTML comments, Python and shell comments based on the document type.
Note: Some source file formats, such as Ragel, may require different comment styles in different part of the code. Eddie is able to automatically pick the right one, depending on the context of the selection.If you wish to choose a commenting style other than the default, you may pick it from the Commenter menu:
You may also just comment out the selected text, using the Comment Selection command, Command-Control-/.
Clicking on the full prototyper button pastes the prototypes into the current selection.
All of the above commands toggle comments -- if the selected text is commented out, the respective command will strip the comments.
These keyboard shortcuts are configured for commenting by default:
Comment Or Uncomment Lines |
Command-/ |
If commented, uncomments selected lines, otherwise comments lines out using the default comment style. |
Comment Or Uncomment Selection |
Command-Control-/ |
If commented, uncomments selected text, otherwise comments selection using C-style, Python or HTML-style comments. |
#if 0 |
Control-0 |
Wrap the selected lines with an #if 0/#endif pair |
There are several other primitives available, you may bind any of these to a keyboard shortcut with SetKey in the UserStartup document:
Primitive |
Default Shortcut |
Description |
UncommentOrAlternateComment |
If selected lines commented, remove comments, else use alternate comments, based on document type; (C comments for C++ documents and vice versa) |
|
UncommentOrCComment |
If selected lines commented, remove comments, else comment using C style comments |
|
UncommentOrCCommentSelection |
If selection commented, remove comments, else comment selection using C style comments |
|
UncommentOrCPlusComment |
If selected lines commented, remove comments, else comment using C++ style comments |
|
UncommentOrCommentSelection |
Command-Control-/ |
Comment Or Uncomment Selection described above. If commented, uncomments selected text, otherwise comments selection using C-style, Python or HTML-style comments. |
UncommentOrPreferredComment |
Command-/ |
Comment Or Uncomment Lines described above. If commented, uncomments selected lines, otherwise comments lines out using the default comment style. |