As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What are some useful shortcuts in Eclipse?
My favorite: Ctrl+2, R to rename all instances of a variable in a class.
ctrl + shift + / to minimize all folding block.
ctrl + shift + * to expand all folding blocks.
Of course you have to have folding enabled :D
I love editing ones.
Ctrl + Shift + M = Add import
Ctrl + Shift + F = Reformat (the best)
Ctrl + Shift + O = Organize Imports
Ctrl + / = Comment
Ctrl + \ = UnComment
Ctrl + I = Correct indentation
Also this ones handy.
F3 = Goto declaration
A Whole List can be found here -->
Eclipse Shortcuts
Some of My favorite shortcuts :
1) ctrl + Shift + R //Open Resource
2) ctrl + Shift + / and \ //For Add Block and Remove Comment.
3) ctrl + Shift + O //For Auto import of packages.
4)ctrl + 7 //For inline comments.
5)Ctrl + Shift + F // Reformatting
6)ctrl + Space //Off course for intelligence
Ones I use most often
Ctrl + space auto complete.
Ctrl + / to comment a line/block
sysout to expand to system.out.println();
syserr to expand to system.err.println();
F3 for go to declaration
F4 to display hierachy
and select text and press Ctrl + Arrow UP/down, try it
This picture short cut for Eclipse will helps.It gathers most of short cuts in Eclipse in
categories.Certainly it has what your want.
Related
I know in pycharm if we want to undo and the last change location is not in current page, the first ctrl + z would bring you to that location with cursor on it and the second ctrl + z would do the job. Do we have the same feature in vscode?
It is annoying that when I hit ctrl + z and it jumps to some part of the code and undos directly. Sometimes I just wanted to know what was there before undo it.
There a few ways to approach this.
Navigate History CTRL + TAB
Go Back ALT + ← / MAC CTRL+-
Go To Last Edit Location CTRL + k + CTRL + q / MAC ⌘ + k + ⌘ + q
Use the command palette to go to recent files
You could remap CTRL + Z, or more specifically, the when expression, to something less forgiving
I suspect the 2nd/3rd option is what you are looking for
I have a problem I can't seem to solve. I wish I could hide the comments documentation of properties, methods... but when I use the shortcut ctrl + cmd + shift + < (available in “Editor” » “Code Folding” » “Fold Comment Block”) Xcode hides only the classical comments but not the comment documentation. If anyone has a suggestion it would be very cool, thanks ^^.
You can try this:
Go to Editor -> Code Folding -> Fold Comment Blocks
or shortcut:
Fold: Shift + Control + Command + Left
Unfold: Shift + Control + Command + Right
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I want to understand how basic things are working in eclipse in the code.
For example if I do hover on annotation or any change in the editor ( draw words )
How I can know which code of Java was called ( class.. )?
maybe could be some spy in eclipse to find code
If you have the mouse over a class type or return type for a couple of seconds the documentation will pop. If when it pops you put the mouse over it, after another second or 2 you will be able to scroll. Basically there is all the info about the class.
Some shortcuts you can use to interact with your classes are:
Ctrl + 1 - See options for a methodCall or a selected snippet of code
Ctrl + Shift + H - See call hierarchy for that method
Ctrl + Alt + T is find Type it will help you quick find it.
Shift + Alt + Q - See class outline view
For further reading you can see some of the most popular shortcuts people use.
When you practice them a bit your life will be easier.
For further reading see this link: http://rayfd.me/2007/05/20/10-eclipse-navigation-shortcuts-every-java-programmer-should-know/
If you want to find out a class declaration:
F3 (Windows)
Fn + F3 (Mac)
If you want to find a reference of a given variable in a file:
Ctrl + Shift + U (Windows)
Command + Shift + U (Mac)
If you want to find a reference of a given variable in the workspace:
Ctrl + Shift + G (Windows)
Command + Shift + G (Mac)
I currently use a variety of keyboard shortcuts in Eclipse such as:
Ctrl + Shift + R: Open Resources
Ctrl + F6: Switch Files in Editor
Ctrl + Q, ? To switch to desired window
Ctrl + Alt + R: To Restart My server
Ctrl + O: To view an outline of a class
F12: to go to the editor
What are some other productive shortcuts I may not be using?
Shift + Ctr + L
This opens the list of keyboard shortcuts ;-)
My favorite is quick access: Ctrl+3 and start typing anything you are looking for...
Here are my frequently used hot keys and I do think they improve my productivity very much
Alt+/ to use the code templates that are defined in the Windows→Preferences→Java→Editor→Template
Ctrl + Shift + R to find files of any type.
Ctrl + Shift + O to organize imports and import the missing imports automatically
Ctrl + Click on a variables / functions to go to its declaration
Ctrl + T on a method or class shows the whole inheritance tree, for example all methods which implement an interface.
In vim, pressing * in command mode performs an automatic search of the word under the cursor. How can I obtain the same in Eclipse?
A combination of two keystrokes:
First, hit Ctrl + Shift + Right Arrow to invoke "Select Enclosing Element". This will select the word under your cursor.
Use Ctrl + K (Cmd + K on OS X) to "find next".
It appears it was not possible in 2004, and it's still not possible, apparently. I'm speechless...
I also need this functionality and created a small plug-in which adds commands for doing this. You can download it and find more details here: http://eclipselabs.org/p/eclipse-tweaks/
Windows 10, tested on Eclipse 2020-03:
Two Steps:
1. Alt + Shift + Up Arrow, to select the word under the cursor
2. Ctrl + K to find the selected word forward
(Ctrl + Shift + K to find the selected word backward)
NOTE:
If you are inside an XML tag, Alt + Shift + Up Arrow will select from the beginning of the tag to the end tag, including all enclosing elements. Try it!
BONUS:
Ctrl + Shift + Down/Up arrows to navigate methods, as sometimes the selected word is a method you want to go to.
Better still,
Ctrl + O - Go to a specific method, by searching (Just enter the first few letters of the method, and Enter)
Cheers
Press Ctrl + k on a Windows machine. On a Mac, Cmd + k should work (seen here).
Not exactly the same, but maybe helpfull if you work with java. In a .java file you can press
CTRL + SHIFT + u
to find occurences in the same source file.
You can also use Shift + Ctrl + K to search next backwards.