[Looking for Charlie's main web site?]

Switching among source windows in Eclipse/CFEclipse

Note: This blog post is from 2006. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
Those who know me well know I'm a big fan of keyboard shortcuts. I could give a whole session on them (and perhaps someday will), so I want to share one that I learned and which is useful if using Eclipse, CFEclipse, or FusionDebug. While many know ctrl-tab will swap among windows in many programs, that doesn't work in Eclipse. Try ctrl-F6 instead, which will show a drop down list of open files and let you scroll forward through them. To go backwards in the list, use Shift-ctrl-f6. Cheers.

PS For other keyboard shortcuts I've shared, going beyond things related to CF, check out the category/tag on the topic at my other (older) blog, tipicalcharlie.com: http://www.tipicalcharlie.com/tags/?/keyboard%2Bshortcuts (domain gone, page recovered from Archive.org)

PPS The entry above on ctrl-f6 is just one more point to be made about looking at Eclipse as a whole when using either CFE or FD. Don't just focus on what those plug-ins add, but rather also on the built-in features of the Eclipse interface which may help you with day-to-day functionality.

Update: Since writing this in 2006, note the several comments below where people offered still more. And of course since then CFBuilder has come out, and with its built-in Aptana offers still more of them. Indeed, in a talk I did on hidden gems, I list other shortcuts for switching windows.

For more content like this from Charlie Arehart: Need more help with problems?
  • If you may prefer direct help, rather than digging around here/elsewhere or via comments, he can help via his online consulting services
  • See that page for more on how he can help a) over the web, safely and securely, b) usually very quickly, c) teaching you along the way, and d) with satisfaction guaranteed
It is also good to note that it is /very/ easy to re-assign the shortcut to a CTRL-TAB if one so desires...
# Posted By Critter | 11/20/06 7:16 PM
Cool to hear, Critz. Please do elaborate for the folks at home. :-)
# Posted By Charlie Arehart | 11/20/06 7:37 PM
Sure mate..

In Eclipse:

Window / Preferences
General / Keys

Scroll all the way down to the bottom. About 12th from the BOTTOM you will see category "Next Editor".
Double Click that line. The modify screen for that action will open up.
Set focus to the Key Sequence section, and hit CTRL-TAB, then click the ADD button. You should now see TWO commands for "Next Editor". You can now select the original one, and click Delete.
Hit Apply... and Bob's yer uncle.. You are sorted
# Posted By Critter | 11/20/06 7:46 PM
I find that CTRL+PageUp/Down works fine, although I do miss CTRL+TAB, so that's a great little tip...
# Posted By David Low | 11/21/06 4:04 AM
Hi charlie,

Instead of CTRL (Or Apple key if you are on a mac) + F6, CTRL + E I find is easier on the fingers and does the same :)
# Posted By Andy Jarrett | 11/21/06 5:50 AM
The [CTLR]+[E] shortcut, in my opinion, functions a little better than the [CTRL]+[F6] functionality. The [CTRL]+[E] shortcut allows you to type in characters to filter you list down and then you use the arrow keys and then the [ENTER] to navigate to the page. There are times when I might have 20+ files open and I find this method more convienent.
# Posted By Dan G. Switzer, II | 11/21/06 9:26 AM
Guys, thanks for all these extra tips. The fact is that we've now identified 3 very different approaches. They're not all the same, though they're indeed all worth knowing about as alternatives.

First, David's Ctrl+pgdn/up does indeed work more like ctrl-tab then either of the others. It just jumps to the next or previous open file. Interestingly, when at the right-most displayed file, it switches to working like the Ctrl-E option Andy mentions.

And that differs from the ctrl-f6 option in the way that Dan mentions: it shows the pop up of files like ctrl-f6, but it adds the ability to type in characters to find matching file names.

All very nice. I didn't know about any of them so I hope that one of them appeals to readers. Cheers.
# Posted By Charlie Arehart | 11/21/06 11:27 AM
Adobe has a keycut for most of their apps, used to switch back and forth between open windows.

CTRL + TAB to move forward through the list
CTRL + SHIFT + TAB to move backward through the list

That's how I've got my mappings.
# Posted By Andy Matthews | 1/23/07 12:10 PM
Sure, Andy, and Critter had said the same in the first comment above, and offered the steps on how to do it in a subsequent one. BTW, the use of Ctrl-tab is not restricted to Adobe apps. Most do it, from my experience. But yes, it's nice to add that to Eclipse as discussed above.
# Posted By Charlie Arehart | 1/23/07 3:31 PM
I've mapped my next/previous editor keys to CTRL-TAB/CTRL-SHIFT-TAB, but I'm still unhappy with their behaviour, because instead of going to the next active tab in the displayed order, these commands cycle through the recently activated tabs. I know some people prefer it this way, but I'd rather change it and unfortunately I couldn't find any way to do that :(
# Posted By Rau | 2/5/09 4:51 AM
I made myself an AutoHotKey script to bring back the classic Ctrl+Tab behavior back to Eclipse. It basically maps Ctrl+(Shift+)Tab to Ctrl+PageUp/Down (see link for details).
# Posted By CyberShadow | 4/19/10 5:07 PM
Thanks for sharing that, Cybershadow.
# Posted By Charlie Arehart | 4/19/10 11:57 PM
I have started using Ctrl-Shift-R which allows me to type in the name of any file in the project. Saves having to navigate my way to the proper spot in the hierarchy.

I find myself using it even when I am switching between editors that are open! I also use the Ctrl-Tab(F6) or Ctrl-E, but seem to get all the functionality of Ctrl-E with Ctrl-Shift-R, and have the ability to open new files to boot.
# Posted By stevenaz | 11/15/11 10:24 PM
Thanks for the additions, Steven. Your comment on this entry from 2006 made me realize there is some updated info I have that I should point to, so I have added an update within the text above, and I also point them to all the comments (from you and others) in the few years since the posting. Cheers.
# Posted By Charlie Arehart | 11/16/11 10:06 AM
Copyright ©2020 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the html in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting