Returning to previous editor tab in Delphi

Having done a lot of Visual Studio work lately, I’ve grown accustomed to the VS way of switching between open file tabs with the Ctrl+Tab keystroke: it switches between files in Most Recently Used order, the same way Alt+Tab does for open programs. This is extra easy when, while coding, you have to do a lot of switching back and forth between just two or three files. You can do so from your keyboard without reaching for your mouse.

I didn’t notice how much I’ve gotten used to it, until recently I had to do a lot of Delphi work again. Using Ctrl+Tab in Delphi also switches between tabs, but in the order the tabs are placed at the top of the editing window (mostly the order you loaded them in). While this is admittedly more predictable when you have lots of files open, in practice I find it much less useful. When I have lots of files (tabs) open, I rarely use the tabs at the tab to switch between files but instead use the Project Manager or hit Ctrl+F12 and start typing the unit name.

Looking for a Delphi equivalent of VS-like behavior for Ctrl+Tab (or a plugin that takes care of it), I stumbled upon this post by Joe White from a couple of years back. He mentions the use of Ctrl+B, which brings up a opened units list, but with the units sorted in MRU order, and with the focus already on the previously opened unit. Because of this, Ctrl+B followed by ENTER, immediately brings you to the window you previously were.

Ctrl+B brings up a unit list in Most Recently Used order, focusing the previously opened unit.

Ctrl+B brings up a unit list in Most Recently Used order, focusing the previously opened unit.

Summarized (Visual Studio -> Delphi)

  • Ctrl+TAB -> Ctrl+B, ENTER
  • Ctrl+TAB,TAB -> Ctrl+B, down arrow, ENTER
  • Ctrl+TAB,TAB,TAB -> Ctrl+B, down, down, ENTER
  • etc.

Still not exactly, but almost as good.


Over Shiftkey
I am Maarten, owner of and chief software developer for Shiftkey software development from The Netherlands. I will be writing mainly about things I run into when programming in C# or Delphi.

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen. logo

Je reageert onder je account. Log uit / Bijwerken )


Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s

%d bloggers liken dit: