Eclipse CTRL+A, CTRL+E go to beginning go to end of line - eclipse

I searched and was very surprised that I can't find a possibility to make CTRL+A, CTRL+E work. So I can jump to the beginning or end of the line. I'm working on a Mac and don't have Pos1 or Home Button on my keyboard.
I'm pretty used to it, because everywhere I need it, it exists, not so in eclipse.

When you set custom keys in eclipse - just make sure that the keys you assign are not already assigned to different actions.
e.g.
enter "ctrl+a" into the filter field and "unbind" the shortcut from all actions that you don't need
select action you want ("line start"), put cursor in "Binding" field and click Ctrl+A

Enter command + -->). this will work.

Another option I found was:
going to preferences
to general -> Editors -> keys
from Scheme select Emacs
Sorry I tried to post a pic, but apparently I need more points...

Home (goes to beginning of the line),End(goes to end of the line) works for me )

Related

Aptana/Eclipse Find Next Shortcut - for Find in Files

i see this post. but i still dont see any way to be able to quickly step through a bunch of search results, making edits, and using a shortcut key to advance to the next result. the Find Next shortcut only works in the Search Tab window, not in the Editor window, where i have focus, while editing. I have to keep clicking on the next result and then clicking in the editor window to make my edits.
Seems so basic, i must be missing something.
i now see that Ctl+K is set to do something similar.
Ctrl+Alt+G is a default shortcut to search currently selected text in the whole workspace (Search>Text>Workspace from menu).
There are no default key mappings for searching selected text in file and in the current project but I find it very usefull added (Ctrl+Alt+F, and Ctrl+Alt+P respectively (Window>Preferences>Keys))

Is there a hotkey in Eclipse to "Open declared type"?

When hovering over a variable, one can go straight to its definition pressing F3. But what I'm looking for is for a way to go directly to its type definition, which I'm currently doing by pressing CTRL + clicking "Open declared type".
Is there a easier way to do this?
Assign a key stroke for 'Navigate > Open Hyperlink' command via 'Preferences > Keys'. (I use F6)
Now you can use this key stroke instead of using Ctrl+Click to bring up the hyperlink popup.
Not exactly what you are looking for, but this is the best solution I think.
There is another option, using Ctrl+Shift+t. This opens a window where you can look up any type you wish. This becomes a shortcut when you highlight your target, press Ctrl+Shift+t and hit enter. Imho Ctrl+Click is still faster.
If you would like to check any other shortcuts bind keys go to Windows -> Preferences -> General -> Keys
I've always relied on a combination of ctrl+shift+t and the hover options. I never thought of the key stroke assignment. I might try mapping a scroll button click, like opening a link in a new tab.
in Windows > Preferences > Keys
search for Go to Type and assign it a ctrl-f3 or shift-f3 (there is a conflict with ctrl-f3)

How to enable "live search" in eclipse?

In Komodo Edit, an input field is available in the toolbar. When I type text in it, it highlights matching search results. Is there something like this in Eclipse, either directly or via a plugin?
As TK Gospodinov has already mentioned, there is an Incremental option in Find/Replace (Ctrl+F) dialog.
There is also a special key binding for Incremental search in Eclipse (and personally I use it more frequently). From Eclipse Tips and Tricks:
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.
If you'd like to have search functionality in a toolbar, you may be interested in the eclipse-glance plugin, which allows you to use the incremental search function in a toolbar by pressing Ctrl + Alt + F while in any text area.
This feature is already available in eclipse. No need to install any plug-in.
Press Ctrl+F, and the Find pop up appears.
Now check the incremental checkbox, and then your texts will be found as you type. No need to hit return.
OR
Use Ctrl+J and you can activate the live search, just that there wont be any UI visible, but you can see the status in eclipse status bar at the bottom.
Press Ctrl+J, start typing the text you want to search for. Press esc to go back to edit mode
The closest thing to the functionality you are asking about is the 'incremental search' mode, which is triggered by checking the 'Incremental' checkbox in the Options group on the Find/Replace dialog in Eclipse (Ctrl+F from the code editor). This will make it start highlighting matches as you type, and if they are keywords, Eclipse will highlight other occurrences (references) in the code editor. Matches inside strings or Javadoc will not be highlighted, however, unless it happens to be the first match after your cursor's position inside the editor.
One similar thing (not the same) is just enabling "mark occurences", then selecting function name, variable etc.

How can I go to the next Eclipse marker (e.g. build error) using the keyboard?

Suppose I make a method signature change that breaks several callers, and I want to review the call sites manually to update them.
Once I change the signature, my "Problems" view shows, say, a dozen errors.
What keys can I hit to navigate through them while leaving the keyboard focus in the editor for fast fixups?
(It's been a while, but I think the Visual Studio equivalent is F8.)
Note that this question does not duplicate Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)?, as that one seeks to navigate only between markers in the current file. In this case, I want to go to the next error regardless of which file it's in.
("Marker" is the general Eclipse term for errors, warnings, etc.)
The best I've come up with so far is Ctrl + F7 to flip to the Problems view, then ↓ to pick the topmost error, then Enter to go to it (which returns focus to the editor).
Here's a way to move to the next error, regardless of editor, in one keystroke. It's not perfect, but it works until it's fixed in Eclipse.
Open a "Markers" view. Click the down arrow at the top right, and choose "Configure Contents". Uncheck the show all box, and create the view to show only the problems you want to see. You'll probably want to deselect "warnings" and "errors" as well. Save it.
Click the same "Markers" down arrow, and choose "Group By". Select "None". This is important because you don't want the parent tree level nodes to show, otherwise some of your "next" actions will take you to those, which don't represent an error.
In Eclipse -> preferences -> keys, search for "Markers". If there is not a keystroke bound to the Markers view, create one. I use Ctrl + Shift + M
Get a keyboard hotkey tool like AutoHotKey (for PC's) or iKey for the Mac. I'm using iKey, but there are plenty of other Mac tools you can use. In your hotkey tool, define an action for the keystroke you want to use for "next error". I chose the standard CMD + .
For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:
Ctrl + Shift + M
Down arrow
Enter
Of course, you'll want to change the first one to whatever you picked for yours. You'll probably want to restrict that action to be executed only when Eclipse is the current application.
Save that, create some compile errors, and test it.
Try Ctrl + 3 for Quick access popup window.
If the "Markers view" is not already visible, then type in "markers", in the searchbox on the popup window. Once you have selected it, it should stay available, when you press Ctrl + 3 the next time around.
I just had the same problem, after refactoring some parts of code. I had a lot of errors in different files and i had to go through all of those.
I used the following solution:
Mark all (relevant) entries in the Problems view.
To do this switch to the Problems view using Ctrl+F7 and select the entries with Shift+↓/↑
You can also select all entries using Ctrl+A
Open the marked errors by pressing ↵.
Every file containing at least one marked error will be opened.
The cursor will automatically select one error/file, as if you open only this specific entry
Fix the errors in the opened file.
Here you can use Ctrl+. to navigate to next error inside this file
Close the file using Ctrl+W when your done.
Eclipse will automatically focus the next file and you can go back to step 3
In my case this solution was much faster then switching to the Problems view each time.
There's an Eclipse bug entered for this that has an attachment that looks like it does what you want.
You could use AutoHotkey:
save the mouse position, send a mouse event to click on the arrow in CDT console and then return the mouse back to it's original location. Record the mouse coords with window spy or use autohotkey's search by image function (first capture the images of two arrows with printscreen into bitmaps).

How do I hotkey directly to File Search tab in Eclipse

When I use CTRL+H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible?
See image here for what I'm talking about:
You can just define a key binding that opens the file search:
Go to Preferences > General > Keys
Type "file search" in the search box. (If there are no results, and you have a really old Eclipse version, select the Include Unbound Commands check box.)
Put the caret into the Binding text box and press the key combination you want to use:
You can either re-use the CTRL+H binding (delete the other binding in that case) or define another one (e.g. CTRL+SHIFT+H). To delete the other binding search for "Open Search Dialog" and click on Unbind Command.
Other solution: You could press CTRL+3 in your editor, type in "file s", press Enter. The next time you press CTRL+3 "File Search" is at the top.
Another option is to open the search dialog (Ctrl+H) then click customize and hide java and task search tabs, next time you do Ctrl+H, file search will be the only one showing, thus it will be selected by default
I actually think the best (and easiest way) is to simply open the search dialog (ctrl + h), hit customize, and then select the checkbox for "Remember last page used." Then tab over to the File Search once. So long as that is the last search tab you used, it will always open there. The advantage to this is that you don't lose easy access to the other tabs, should you actually need them! (working in Eclipse Kepler).
I learnt to use a "pseudo-hotkey" ALT+A F (works also as ALT+A ALT+F), which resolves to: "Menu Se[a]rch → [F]ile..." and has the advantage of being always present, without need for reconfiguration.
I've run into this problem before, too.
I tried following the advice in the question response given by #Martin to rebind Ctrl+H to "File Search" in Window | Preferences | General | Keys, but for some reason, I don't have a "File Search" entry in the Command column. (I'm running Eclipse 3.3 currently; maybe the "File Search" entry was added in a subsequent release?)
Update: As Martin pointed out in a comment on this answer, I didn't have the "Include unbound commands" checkbox checked in the Preferences | Keys dialog, which is why "File Search" wasn't showing up for me. I now have Ctrl+H bound to "File Search", as Martin suggested in his answer on this page, and it works great. Thanks Martin!
I ended up working around the original problem by bringing up the Search dialog with Ctrl+H, then clicking the Customize button on the dialog, which brings up a "Search Page Selection" dialog which allows you to hide or show tabs on the Search dialog. I hid the tabs other than "File Search," which causes "File Search" to be activated by default on future uses of Ctrl+H.
As far as I know, the search window tab depend of the open file you're on when calling the search function. So, for example if your on a web.xml file, it will open the "plug-in search" instead of the "java-search".
Edit: there is a way to force the default open tab, by assigning a shortcut to the "File Search" action in the "Keys" preference panel.
Probably this feature came recently [confirmed its there in since Juno] and looks intelligent.
Press Ctrl+H --> Customize --> [Checkbox] Remember last used page.
This way you are not far from other options if required anytime. So if you use File search often then you will not get annoyed getting what you last chose.
I would like to provide a workaround here:
you can 'remember last used page' to avoid opening it over and over again.
UPDATE: user #muescha, in the comments underneath the question, just pointed out to me that I accidentally answered the wrong question! Nevertheless, it is still a valuable answer (just not to this question), so I'm leaving it.
My answer answers the question: How do I use a hotkey directly to search for a File in Eclipse?
Ctrl + Shift + R works fantastically! Use asterisks (*) for wildcards. It is very similar to the Ctrl + P fuzzy search in Sublime Text 3.
Sample searches using the Ctrl + Shift + R "Open Resource" search in Eclipse:
rea
*.txt
*32*f1*c
*3*1*c*h
Notice if you just put an asterisk * between every character in the search string it works just like Sublime Text 3's Ctrl + P "fuzzy search"! Beautiful!
Side note: you can also use the Search --> File menu dialog to search for files.