Is there any shortcut for cleaning a project? Or can we create a shortcut for cleaning the project using:
Window--> Preferences--> Java --> Editor --> Templates?
If yes ,how?
To clean android project:
Window -> Preferences -> General -> Keys (Ctrl+Shift+L)
in type filter text write build clean. There you can bind the key, for ex. Ctrl+Shift+L.
It's quite easy:
Press ALT + P + N.
Release ALT
Enter.
Window -> Preferences -> General -> Keys (Ctrl+Shift+L+L)
In type filter text, type clean. The you will have the possible command and you can assign any short cut you want.
As George said, it is really easy.
Just keep an eye on underlines coming out when you hit ALT .
Then if you follow these underlines, hit P and then N.
Note:
No need have to have ALT pressed down or hit Enter at the end.
In Preferences/General/Keys look for "Build Clean".
You can assign a binding for that command.
Works for me on Mac OS X Kepler.
Related
In Eclipse, if the cursor is over a word and you press Ctrl+K you will jump to the next occurrence of that word in the file.
Is there a similar shortcut in IntelliJ?
Find word at caret, default is Ctrl+F3, can be changed in File | Settings | Keymap:
You will need 2 Steps to archive a similar behavior:
Step 1:
Press Ctrl+F3 to start a search for the current selectet text (if no text is selected then the whole word will be taken).
Step 2:
Press F3 to jump to next occurrence or Shift+F3 to jump to the previous.
This approach will even continue the search for the text if you switch to another file. Just press F3 and you will jump to the next occurrence in the other file.
Shift+F3 works for me in Android Studio / IntelliJ, in eclipse we were using Ctrl+K
I think Android Studio/IntelliJ doesn't play that well, for me, I changed Android Studio Keymap to Eclipse as I used to (My collection tips) and to use Ctrl+K, I press search the string first:
Select the text we want to search
Press Ctrl+F, Enter
Then can use: Ctrl+K in any file we are on
That's what I'm doing, hope can help someone with that.
You can do it using macros:
Edit -> Macros -> Start Macro Recording
Edit -> Find -> Find Word at Caret
Edit -> Find -> Find Next/ Move to Next Occurrence
Edit -> Macros -> Stop Macro Recording
Give some name for the macro, e.g. "simulate Eclipse Ctrl+K"
File -> Settings -> Keymap -> Find the macro "simulate eclipse Ctrl+K" -> bind hotkey Ctrl+K
The same can be done for the Ctrl+Shift+K (use Find Previous/ Move to Previous Occurrence).
There are 2 options like below in : Settings -> Keymap -> Main menu -> Find
Find Next / Move to Next Occurrence
Find Previous/ Move to Previous Occurrence
For me, this didn't work at the start because GIT push shortcut was using the same keys (Ctrl + K & Ctrl + Shift + K). All is good after changing the conflicting GIT shortcuts.
You need to first do Ctrl+F on the selected word, now this gets cached then you can use the Ctrl+L and ctrl+shitf+L for going down and up respectively. This is already present. its just that instead of ctrl+K you got use ctrl+L. small change same effect
Keymap : Mac OS X 10.5+
To start / add to your discrete multiple selection : CTRL+G
To skip the current selection and move to the next : CMD+G
Refer:
Does IntelliJ have a `Ctrl` + `K`,`Ctrl` + `D` Sublime equivalent? How do I skip a match when using Alt+J for multiple selections in Android Studio?
In IntelliJ, if the cursor is over a word and you press Command+G you will jump to the next occurrence of that word in the file. Similarly, you press Command+Shift+G you will jump to the previous occurrence of that word in the file
As was asked previously, Eclipse has the nice "mark occurences" feature, which shows all occurences of the selected variable or method.
But I don't know any shortcut for jumping to the next/previous occurence in the editor.
The shortcut ctrl+k is not working, it solely works in conjunction with "incremental find" (ctrl+j).
I'm using Eclipse Indigo. Is there any shortcut or other solution?
Edit:
The answers and comments in the question linked above are now pretty exhaustive, I think.
It seems there is no all-in-one solution (at least for Java code editing):
I cant get Ctrl + (period) to work, at least in Java code where it finds the next problem. Even rebinding this to a different shortcut does not work.
Ctrl + K does text-based search only. If you want to find all occurrences of the variable i, it finds any letter i within any identifier and comment.
Renaming mode using Alt+Shift+R and then navigating through the occurrences using Tab and Shift+Tab comes close, but only works for identifiers you can actually rename for that source file. It does not work for library code (esp. JDK) for which no editable source is available.
Try Ctrl + , and Ctrl + .
Before that make sure you have checked Occurences in the small navigation dropdown:
You can change the key from Window -> Preferences -> keys:
It works for me.
You can find if your key bindings have changed by looking under Window -> Preferences -> General -> Keys and look for the command Find Next. You will see the binding in the column Binding and can also check if it's conflicting with something else in the list titled Conflicts: at bottom right corner of the dialog.
Is there any way to automatically remove all unused imports (signaled with a warning) of a project with Eclipse IDE?
I just found the way. Right click on the desired package then Source -> Organize Imports.
Shortcut keys:
Windows: Ctrl + Shift + O
Mac: Cmd + Shift + O
You can direct use the shortcut by pressing Ctrl+Shift+O
I know this is a very old thread. I found this way very helpful for me:
Go to Window → Preferences → Java → Editor → Save Actions.
Check the option "Perform the selected actions on save".
Check the option "Organize imports".
Now every time you save your classes, eclipse will take care of removing the unused imports.
Remove all unused import in eclipse:
Right click on the desired package then Source->Organize Imports.
Or
You can direct use the shortcut by pressing Ctrl+Shift+O
Work perfectly.
If you want to do this on whole project then inside project -->select src folder-->press Ctrl+Shift+O
Use ALT + CTRL + O. It will organize all the imports. You can find various other options in the "Code" Menu.
EDIT: Sorry it is CTRL + SHIFT + O
Better way is just to add "save action" so when you save the project it will clear the unused import's and format the code as well if you like .
Go to Window > Preferences > Java > Editor > Save Actions
and pick what ever you want .
press Ctrl+Shift+O and it will remove unwanted imports
Certainly in Eclipse indigo, a yellow line appears under unused imports. If you hover over that, there will be multiple links; one of which will say "Remove unused import". Click that.
If you have multiple unused imports, just hover over one and there will be a link that allows you to remove all unused imports at once. I can't remember the exact wording off hand, but all the links that appear are pretty self explanatory.
Not to reorganize imports (not to unfold .* and not to reorder lines) to have least VCS changeset
you can use custom eclipse clenup as this answer suggests
Warning: It is not programming related question ...I just want to know how can any text I can find from whole folder which I select for find?
crtl+f finds a text only in a open document ...but what if i want to know it from whole document ..like in dreamweaver ..when we do ctrl+f it fives trhe option to select folder
...
is there any option in eclipse too ?
Menu Search -> File
Some tips:
To find only on selected folder you can click the option Selected resources
You can define a keybinding for File Search from Preferences -> General -> Keys. Look for Command File Search
Using Ctrl + H would give you a starting point.
Hit Ctrl+L for a quick look at the shortcuts available in Eclipse. Ctrl+L+L (L twice on hold of Ctrl) will let you customize the shortcuts.
Press Ctrl + H, should bring up the search that will include options to search via project, directory, etc.
Ctrl + Alt + G can be used to find selected text across a workspace in eclipse.
Title more or less says it all. Specifically, I've become increasingly annoyed that in order to run an ant script I have to use Alt+Shift+x, q. But I think If I had this power I would many things I would change the shortcuts for/add shortcuts for things that don't currently have them.
Window > Preferences > General > Keys
In particular, edit the "Run Ant Build" command.
For Windows:
Window > Preferences > General > Keys
For mac that would be
Eclipse > Preferences > General > Keys
Pressing Ctrl + Shift + L will open the current list of defined shortcuts, again pressing Ctrl + Shift + L will open preference page from where the shortcuts can be modified.
As a side note make sure your newly mapped Shortcut won't have any conflicts on the right of the Keys window/menu.
If so choose a combination that will work; doesn't have any conflicts with existing ( default ) settings.
Hope this helps.