Important shortcuts for Eclipse & CFEclipse

Posted by Dan on Jul 10, 2008 @ 10:53 AM

[UPDATED: Friday, April 17, 2009 at 10:27:41 AM]

Two great posts by Mike Henke and John Whish over the past week cover some really important keyboard shortcuts for Eclipse & CFEclipse. They cover the gamut of some of my favorites (like CTRL+SHIFT+R) and some ones I always forget about (such as CTRL+DEL and CTRL+BACKSPACE.) These are definitely shortcuts you should be memorizing to make you work more efficient.

General Eclipse Shortcuts

[CTRL]+[SHIFT]+[L]
A list of all keyboard shortcuts (not mapped by default in CFEclipse--you can create a copy of this shortcut in the Keys preferences and map to [CTRL]+[ALT]+[K] which is open in CFEclipse.)
[CTRL]+[M]
Maximizes (or minimizes) the current pane (editor or view.) This is a handy way to maximize your editor to take up the full screen.
[CTRL]+[K]
Finds the next occurrence of the highlighted text. (NOTE: This is one of the best ways to jump around your document.)
[CTRL]+[SHIFT]+[K]
Finds the previous occurrence of the highlighted text.
[CTRL]+[H]
Brings up the Search & Replace dialog.
[CTRL]+[D]
Delete the current line.
[CTRL]+[SHIFT]+[DEL]
Deletes to the end of the current line.
[CTRL]+[DEL]
Deletes the next word.
[CTRL]+[BACKSPACE]
Deletes the previous word.
[CTRL]+[SHIFT]+[X]
Converts highlighted text to uppercase.
[CTRL]+[SHIFT]+[Y]
Converts highlighted text to lowercase. </DD
[CTRL]+[Q]
Goes to the last place you made a change.
[ALT]+[LEFT]
Goes "back" to the last open editor in your viewing history.
[ALT]+[RIGHT]
Goes "forward" to the next open editor in your viewing history.
[CTRL]+[E]
The Quick Switch Editor opens a list of all open editors and allows you to quickly switch to any open file.
[CTRL]+[SHIFT]+[R]
The Open Resource dialogs allows you to quickly open any files in your workspace. This is one I use all the time.
[CTRL]+[3]
The Quick Access menu pretty much helps you find anything in Eclipse by providing a keyword.
[CTRL]+[SHIFT]+[E]
The Switch to Editor brings up a list of all open editors (and can even span multiple windows.)
[CTRL]+[UP]
Moves the current (or highlighted) rows up one line.
[CTRL]+[DOWN]
Moves the current (or highlighted) rows down one line.
[CTRL]+[ALT]+[UP]
Inserts a copy of the currently highlighted line above the current line.
[CTRL]+[ALT]+[DOWN]
Inserts a copy of the currently highlighted line below the current line.
[CTRL]+[ALT]+[RIGHT]
Shifts (indents) the current or highlighted line(s) to the right. Much faster than highlighting the line(s) and using the [TAB] key.
[CTRL]+[ALT]+[LEFT]
Shifts (un-indents) the current or highlighted line(s) to the left. Much faster than highlighting the line(s) and using the [SHIFT]+[TAB] key.
[CTRL]+[HOME]
Jumps to the beginning of the current file.
[CTRL]+[END]
Jumps to the end of the current file.

CFEclipse Shortcuts

[CTRL]+[3]
Wraps text inside #...#.
[CTRL]+[T]
Edit current tag.
[CTRL]+[SHIFT]+[A]
Inserts <cfabort/> tag.
[CTRL]+[SHIFT]+[D]
Inserts <cfdump/> tag.
[CTRL]+[SHIFT]+[O]
Wraps text inside <cfoutput>...</cfoutput> tags.
[CTRL]+[SHIFT]+[N]
When focus is inside of an HTML/CFML tag, it will jump to the matching open or close tag.
[CTRL]+[SHIFT]+[U]
Converts highlighted text to uppercase. (NOTE: I recommend using [CTRL]+[SHIFT]+[X] instead because it's a general Eclipse shortcut.)
[CTRL]+[SHIFT]+[L]
Converts highlighted text to lowercase. (NOTE: I recommend using [CTRL]+[SHIFT]+[Y] instead because it's a general Eclipse shortcut.)
[CTRL]+[SHIFT]+[P]
Wraps text inside <p>...</p> tags.
[CTRL]+[SHIFT]+[C]
Wraps text inside a contextual comment (i.e. <!--...--> for HTML, /*...*/ for scripts).
[CTRL]+[SHIFT]+[M]
Wraps text inside <!---...---> tags.
[CTRL]+[SHIFT]+[Z]
Opens the color picker.
[CTRL]+[\]
Expands or collapses the current code block (<cfif>, <cffunction>, <cfswitch>, etc.)

In CFEclipse, most of your standard shortcuts for formatting (i.e. [CTRL]+[B] = strong) work as well. Learning keyboard shortcuts can really speed up your development process, so I recommend trying to learn one or two a week and introduce them into your coding habits.

Categories: HTML/ColdFusion

27 Comments

  • Sweet! Printing this out now - there are some huge time savers here. Don't forget about CTRL+ENTER (inserts a <br/> tag) and SHIFT+ENTER (breaks to a new line no matter where you are without a hard carriage return).
  • Another one I find handy. I think I discovered it accidentally even.
    [CTRL]+[\] - collapses or expands the current code block (within cffunction, cfif, cfswitch, etc)
  • ctrl+k: does a forward "find next" within document on whatever's currently highlighted

    ctrl+shift+k: does a *backward* "find next" within document on whatever's currently highlighted

    ctrl+alt+up: repeats the line that's currently highlighted

    ctrl+home: jumps to beginning of doc
    ctrl+end: jumps to end of doc

    ctrl+H: file search & replace dialog

    I'm on Eclipse 3.3.1 (not sure if that makes a difference). Also, in my Help menu there's a Key Assist item that gives you more all shortcuts available. :)

    btw - if you can, update your blog software to accept emails with plus signs - see http://cfzen.instantspot.com/blog/2008/04/30/Does-...
  • @Aaron:

    I can't believe I left off [CTRL]+[K] and [CTRL]+[SHIFT]+[K]. I use those two shortcuts more than any others.

    I've updated the list with some of the other suggestions.
  • Splitting hairs a bit, but [CTRL]+[SHIFT]+[C] actually wraps the text in comments based on the section of the file. So in html it does !--, but in javascript and cfscript it does /* */

    Great list btw
  • @Rob:

    Thanks for the info. I've updated the list to specify the comments are contextual. I wasn't aware that they were.
  • System Analyst Abhijeet's Gravatar
    System Analyst Abhijeet
    This is pretty extensive list of Eclipse. I can say, I did not know [CTRL]+[\] and should be of good use for me. Passing on the blog URL to my team mates

    Abhijeet
  • @Abhijeet:

    Quite frankly, the most important one is: [CTRL]+[SHIFT]+[L] (which you need to make a copy of to work in CFEclipse.) That brings up the "Show Key Assist" pop-up which shows you ever keyboard shortcut currently available to you. While this list can be quite cumbersome, it's great to have at your finger tips and a great way to "remember" those keyboard shortcuts you keep forgetting.
  • @Dan

    FYI - Abhijeet is a comment spammer. His posts are just enough on topic to look legit, but he is a SEO slimeball.
  • @Cameron:

    Thanks for the heads up. I've removed his link.
  • I can't believe I forgot about these 2.

    [CTRL]+[UP] - moves current line or selected lines up one line
    [CTRL]+[DOWN] - moves current line or selected lines down one line

    I use them in conjunction with Ctrl-Alt-Up / Down all the time. Note that adding the Alt modifier copies either the current line or selected lines (automatically expands to full lines if partial selected).
  • Note, you listed [CTRL]+[SHIFT]+[N] 2x on your list, for matching open/close and the color picker. I believe the color picker is [CTRL]+[SHIFT]+[Z]
  • @Mike:

    Thanks for the correction. You are correct and I've updated the list.
  • I've updated the list with a few more suggestions and other keyboard shortcuts I've started using.
  • Hi Dan,

    I just wonder if there is any (CF) Eclpise plug-in is available to have the design view of a html/cfm page?..

    Regards,
    Dav R
  • @Dav R:

    You can only use one "editor" at a time in Eclipse. So even if you find an HTML designer editor for Eclipse, you wouldn't be able to use it and CFEclipse at the same time.

    As for whether a design editor exists, I really don't know (I've never looked for one.) You might check MyEclipse--it might have something. I don't really like WYSIWYG. I code faster by hand.
  • I just added the [CTRL]+[M] shortcut which maximizes (or minimizes) the current pane (editor or view.) This is a handy way to maximize your editor to take up the full screen.
  • @Dan: I use just about all of these, but [CTRL]+[SHIFT]+[Z] (color picker) and [CTRL]+[\] (expand/collapse) are new to me -- fantastic! Thanks!
  • Thanks, Dan. Good stuff I need!

    Here's a couple general ones I like. The first one rocks! :

    Alt + Up/Down - Select and move an entire line. No need to select the line! Or move entire selection up or down.

    Ctrl + D - Delete a line.

    Alt + E - Display a filterable list of open Editors

    Ctrl + F6/F7/F8 - Display and switch to available Editor/View/Perspective

    bill
  • I thought there was a shortcut to move between the opening and closing tag. I didnt see that in the list or am I just blind or does everyone just know it its not worth posting?
  • ok I am blind its supposedly ctrl + shift + n but it doesnt work for me in galileo
  • Thanks Dan. That was really helpful.
  • The following does not work on my CFEclipse
    [CTRL]+[3]
      Wraps text inside #...#.

    This used to be my fav.

    Any idea how to add it in?
  • @Alex:

    It looks like the new default key binding is CTRL+SHIFT+H. You can change the behavior by going to Window > Preferences > General > Keys. Find the "CF Variable" command, go down to "Binding" and press CTRL+SHIFT+3.
  • @Dan:

    Do you know how to add your own key assists? I've been playing around with with the "Keys" menu, but I can't figure out how to make my own. I was hoping to be able to surround text with <a href=""></a>.
  • @Ethan:

    You can't do that. You can create a snippet though, which you can then assign to a trigger text. See this page for more information:

    http://blog.mxunit.org/2009/04/timesavers-cfeclips...

    Not the exact same thing, but it might fit your needs.
  • I need a shortcut for <cfset >! cfeclipse allows you to copy an existing shortcut and bind a new set of control keys as a new shortcut to existing functionality. eclipse is not written in Martian. Surely there's been someone adventurous enough to have slipped into the executable or the .jar or somewhere applicable the necessary whizbang to insert a new shortcut?

Comments for this entry have been disabled.