Updated RDi Keyboard Shortcuts
January 12, 2016 Susan Gantner
I’ve written tips about RSE/RDi keyboard shortcuts several times before. Readers of those tips will know that I created a downloadable list of my favorite keyboard shortcuts. I’ve updated the shortcut card fairly regularly and the most recent edition has recently become available. So if you have previously downloaded my shortcut card and found it useful, you may want to get the latest one here.
This edition of the card includes a few new shortcuts, including a couple that are new for V9.5 of RDi.
The first one is Ctrl+Alt+Q, a new V9.5 shortcut to bring up a dialog box to “Open an IBM i member” directly without the need to drill down in RSE to find the member name in a list. If you’re getting a déjà vu feeling about that, you’re right. I wrote a tip about a shortcut to bring up that dialog back in April. If you read that tip, you know that there was an issue with the old shortcut–Ctrl+Shift+A–and my tip showed how to overcome the issue. With V9.5, IBM‘s developers created a new shortcut for the “Open an IBM i member” feature that doesn’t conflict with other shortcuts so it doesn’t require the re-configuration work that the old one did. For those of you who have already fixed the issue in your workspace, never fear–the Ctrl+Shift+A shortcut still works in V9.5 so you can continue to use it. Others who didn’t know about the shortcut before or who didn’t take the time to fix it earlier can now just use Ctrl+Alt+Q instead.
The second new V9.5 shortcut is more exciting because it is used for a completely new feature in V9.5. Ctrl+Shift+F will now re-format your RPG free-format logic. Re-format in this case means it will indent your code according to your preferences. If you have a block of code selected, it will limit the formatting to that block. If you have no code selected, it will reformat all the free form code in the source member. Undo will work for this action, just in case you find you don’t like the results.
The corresponding new Preferences dialog page (shown in Figure 1) allows you to specify how many spaces you want to use for each level of indentation and how much (if any) you want the WHEN/OTHER statements within a SELECT block to be indented. The same dialog allows you to specify whether you want the formatter to use the columns before 8 and after 80 for those source members that take advantage of the latest RPG free-form enhancement to remove the old column restrictions.
Note that I’ve found the fastest way to get to this preference page is to search for “formatt” as illustrated in Figure 1. If you search for RPG, as I did when first looking for it, you won’t find it. Even better, you’ll also see the preference page for free form SQL formatting. That’s not new; it’s been around quite a while, but since the automatic formatting option is not turned on by default, it seems that many RPGers missed the fact that it exists.
A couple of caveats related to the new RPG Formatting tool. The formatting only works on code that is already in free format. It does not convert from older fixed-format code to free format. You’ll still probably want to use one of the third-party tools to do that work for you. And a word of warning: each line of code that is changed during formatting will have its source change date updated. On the surface this certainly makes sense since the line of code was certainly changed. However, many RPGers, including myself, would prefer to have an option to allow the change dates to remain unchanged in this case. It can be very disruptive to have virtually every change date in a source member updated when simply fixing the sins of past edit sessions where the programmer didn’t use appropriate indenting technique initially. I have been using a similar “indent” feature for a while from the RPG Toolbox RDi plug-in from Linoma Software. It gives me a preference option to leave the change dates intact, so I will likely continue to use that plug-in for formatting RPG code, particularly when formatting old code in a program.
Here are a few shortcuts that are either new or changed in the latest version of my shortcut card, but are not specifically related to V9.5.
The F3 shortcut–used to jump to a subroutine or procedure when positioned on the name–is still there and still works as advertised. However, the way you return from that routine back to the calling location changed a couple of releases back. So the new card now reflects the new way to make that work. Previously, after an F3, you would use Alt-Q (return to Quick mark) to get back to the calling location. Now you must use Alt + Left arrow to go back to the calling location after an F3. In addition, you will find that Alt + Left or Right arrow will allow you to jump back and forth between other actions you’ve done in the editor, such as recent edits.
The last shortcut change to the card is the addition of Ctrl+Shift+D to search for lines of code by source change date. This is not a new feature at all but one that I had never used much myself, so I had omitted it from my “favorite” list. But I’ve had so many people ask me about it that I decided to add it into this latest edition of the card. I’ve been told that it’s particularly good for code review sessions, something that far too few RPG shops do in my experience!
That’s the tour of the new or updated shortcuts from my latest list of favorites. Feel free to download yours and/or request a hard copy card here. And I’m always interested in shortcuts that I may have missed. Let me know if some of your favorites aren’t on my list.
Susan Gantner is half of Partner400, a consulting company focused on education on modern programming and database techniques and tools on the IBM i platform. She is also a founding partner in System i Developer, a consortium of System i educators and hosts of the RPG & DB2 Summit conferences. Susan was a programmer for corporations in Atlanta, Georgia, before joining IBM. During her IBM career, she worked in both the Rochester and Toronto labs, providing technical support and education for application developers. Susan left IBM in 1999 to devote more time to teaching and consulting. Together with Jon Paris, she now runs Partner400, and appears regularly at many technical conferences, including System i Developer’s RPG & DB2 Summit. Send your questions or comments for Susan to Ted Holt via the IT Jungle Contact page.