Guru Classic: My Favorite Keyboard Shortcuts for RSE/RDi
July 17, 2019 Susan Gantner
When using RDi for editing my CL, DDS, RPG, or COBOL code, I find that I can save a lot of time by using keyboard shortcuts for functions that would otherwise require that I take my hands off the keyboard to use the mouse. So I thought I would share a few of my favorites. Many of the shortcuts I use are standard for other applications that I also use for email, spreadsheets or text editing. It’s easy to forget that some of those same shortcuts can be used when we’re editing our RPG code.
A lot has changed on this subject since this tip’s original publication back in 2007. Some of these shortcuts have been updated due to changes or additions in recent releases of RDi. One thing hasn’t changed — my love of keyboard shortcuts. Since this original tip, I have published and regularly updated my downloadable Favorite Keyboard Shortcuts for RDi. Check that out — along with the related stories links below — for a more comprehensive list of shortcuts.
The standard keyboard shortcuts from other applications include ones like these:
- Ctl-C to copy, Ctl-V or Shift-Insert to paste, and Ctl-X or Shift-Delete to cut. There are other ways to copy, move and paste code as well that are RDi-specific. I wrote about them in this tip.
- Ctl-Z to undo – very high on my list of favorites – and Ctl-Y to redo.
- Home jumps to the beginning of a line and End jumps to the end of a line.
- Ctl-Home jumps to top of the member and Ctl-End jumps to end of the member.
- Ctl-F opens the Find/Replace dialog.
- Ctl-S saves the source back to wherever I opened it from — typically the host source member — without closing the member.
Other shortcuts are not standard across other applications, but are specific to some combination of Eclipse or the RDi workbench itself. I use these to help navigate my way around the workbench. Here are some of my favorites:
- Ctl-F6 switches between Editor tabs, i.e., it switches between open members.
- Ctl-E pops up a list of open members for selection.
- Ctl-F7 toggles between Views in the workbench (e.g., from Editor to Outline View).
- Ctl-F8 toggles between open Perspectives (e.g., from RSE to Debug or i Projects).
- Ctl-M maximizes or shrinks a View in the workbench, replacing a double click at the top of the view. There is an exception to this one: it does something completely different in the Editor view. I’ll talk more about that later.
- Ctrl-Alt-Q brings up a dialog to open a member by filling in the library, file and member name when I don’t want to drill down using filters in RSE. In earlier releases of RDi, RDP and WDSC, this was done with Clt-Shift-A.
This last set of favorite shortcuts relate specifically to the LPEX Editor (the editor that RDi uses by default):
- Ctl-Backspace deletes a line. This comes in particularly handy when I have hit Enter too many times and accidentally end up with several blank lines in my source.
- Alt-S splits a line at the cursor position. I find this especially useful when writing RPG expressions and I run out of space on a line. As of RDi V9.6, the Enter key may also be used to split a line.
- Alt-J joins the next line to the end of the current one, which can be useful once I’ve discovered a shorter way to handle that complex expression!
- There are a couple of different shortcuts I find very helpful for sorting out complex nested logic in fixed-form calc specs in RPG. Those are Ctl-M and Ctl-Shift-O.
– Ctl-M (select block) finds the matching End for my code block, such as an If or Do or BegSR in RPG and selects the entire block. It also works in reverse–to find the matching block beginning for an End operation. Note that this is the exception I mentioned earlier to the use of Ctl-M to minimize or maximize a view.
– Ctl-Shift-O (show block nesting) highlights both the beginning and end of a code block using arrows. It also highlights any additional blocks of code that may be nested within that block. - Ctl-F5 clears out things the editor inserts into the source for you – such as those pesky pink error messages that appear in the editor window — if you’re not using the recent option to see messages as annotations — or the arrows drawn to highlight nested logic using Ctl-Shift-O mentioned above.
- Ctl-Shift-V verifies the source in the editor.\
- Ctl-Shift-C compiles the source in the editor.
There are many more keyboard shortcuts, but these are among my favorites. I hope I may have introduced you to a few that you haven’t tried before. Maybe they will save you a little time in the future. If you want to try out some other keyboard shortcuts for the editor, key the command? SEU in the editor command line (press Esc to get to the command line) and you will see a help page with a long list of shortcuts. You may also want to check out some of the related stories below where I describe more of my favorite shortcuts.
Susan Gantner, an IBM Champion and co-author of the popular Redbook, Who Knew You Could Do That with RPG IV, is one of the top speakers/writers/trainers on IBM i development topics. She is a partner at Partner400 and System i Developer, and she hosts the RPG & DB2 Summit twice per year with partners Jon Paris and Paul Tuohy.
RELATED STORIES
Everybody Likes Shortcuts! Part 1, Navigation
Finders, Keepers: Long Lost RSE Keyboard Shortcuts