So -- I thought it would be helpful to start a thread about what our favorite IntelliJ IDEA 4.0 shortcuts are. IntelliJ is the only program that I leave the "show tips at startup" thing on -- beacause I actually learn a lot of cool things in there. But -- I've found that one of the best ways to find out waht other cool features it has is word-of-mouth (or in this case word-of-keyboard I guess). So -- here's my list of really cool stuff I've found I can do with IntelliJ that I use all the time -- what about you?
Alt+Enter -- automagically imports the class you just typed.
Ctrl+Space -- shows all possible methods that could be called at this point.
Shift+F6 -- refactor: renames the class / method / variable, whatever the cursor is on now.
Ctrl+F6 -- refactor: change method signature
Alt+Insert -- popus up a menu to add Getters / Setters / Constructors / Equals / Hashcode
Ctrl+Shift+Tab -- pops up a menu to surround the currently selected code with if/else, try/catch, etc
Alt + --> or Alt + <-- -- tabs between edit windows
[ March 03, 2004: Message edited by: Jessica Sant ]
ahhh forgot the Ctrl+B -- I've started using that one more. I'll have to get int he habit of the Ctrl+F12 for the stucture pop-up. What does the optimize imports do?
Joined: Jul 18, 2001
Originally posted by Jessica Sant: What does the optimize imports do?
Adds any needed imports. Removes any unneeded imports. Condenses fully qualified imports to wildcard imports if the number of imports used in a package goes beyond a configurable threshold. I am addicted to Ctrl+N and Ctrl+Shift+N... so much so that I rarely ever use the file navigator.
Besides Alt-Enter and Ctrl-Space, my favorite IDEA keystrokes actually come from plug-ins. They are Ctrl-t (navigate to or create JUnittest) and Ctrl-C C (execute this single test method) both from the unitTest plug-in. A close third and fourth would be the Emacs-style Ctrl-k (kill) and Ctrl-y (yank) from the IDEAmacs plug-in.
ugh, that Ctrl+Y screws me up.... on other apps (like M$ Word) Ctrl+z is undo and Ctrl+y is redo.... so if I goof and need to undo something... i hit Ctrl+z which works just fine... but if I undo too far and hit ctrl+Y to try to redo it..... it deletes the line!!! so then I have to Ctrl+z again and the whole vicious cycle starts anew.......aaaarrrghhhhh
author and iconoclast
Originally posted by Jessica Sant: ugh, that Ctrl+Y screws me up.... on other apps (like M$ Word) Ctrl+z is undo and Ctrl+y is redo....
That's insane! Everyone knows that control-Z is "suspend" and undo is Ctrl-underscore. And CTRL-v is page-down. And ctrl-a is beginning-of-line and ctrl-e is end-of-line, and ... The existence of the IDEAmacs plugin was the thing that made it possible for me to switch from Emacs to IDEA in the first place.
The most useful one for me is CTRL + J, which brings templates. it is also used with live templates so that if you type "it" and then CTRL + J, you get a list of iterations. type sout and CTRL + J you get a System.out.println("|") statement
For a second there I thought Ctrl-J was not going to be said, but also not said is Ctrl-I, when you have a class implement an interface, hit Ctrl-I and a list of all the methods in the interface are listed. Select the ones you want, which to me is everything, heck you have to implement them don't you, and click ok or hit enter, and the method skeletons are added to your implementing class. Funny thing about Ctrl-J is that is also works in JSP pages, although the only choice you have it tag, but you type in the value for the tag, and both tags get filled with the tag name. I also love Alt-Enter, I mean talk about saving keystrokes. Mark
Alt-F4 seems to work perfectly for me too. It amazes me that every program finds that keystroke to be the best of all the keystrokes that application has. Mark [ April 17, 2004: Message edited by: Mark Spritzler ]