I'm working in a file that's thousands of lines of code. I'm implementing an algorithm at line 700-ish. I frequently have to navigate away from those lines to check out the other methods in the file.
Navigating back to where I'm actually coding is usually a pain. If I could set a waypoint at line 700 and map a shortcut to it that would be great. It would also be nice to be able to do this on a file level too.
Is there any way to do this in Eclipse? If not, should there be?
I don't control the file so I can't break it up into smaller files/classes.
There's a Bookmark view in Eclipse that would probably work for this.
On any line of source (at least in the Java view), right click in the left hand tray. You'll see a menu pop up and an option called Bookmark. Select that and provide some kind of useful description that you'll remember.
Now, add the Bookmarks view to your perspective.
Click on Window
Select Show View
Select Other (at the bottom)
Select Bookmarks under General (or just enter Bookmarks in the search box).
You should now have the Bookmarks view in your perspective listing your bookmarks. Duble click on one of the bookmarks and it will take you right to it.
Hope that helps.
Related
When I search for something in Eclipse and the results show in the Search tab, whenever I click on a result (for example, a .java) it opens in a new tab next to the Search tab (in the lower panel), instead of in a new tab next to the rest of files that are open in Eclipse (in the upper panel).
This is very annoying because I use the lower panel for "tool views" such as Console, Search, Problems, Tasks, etc and I don't want files to be opened in that panel.
I'm sure I'm missing some setting in the preferences but I can't find it and this behaviour is driving me crazy.
Thanks for your help!
I had the same problem and was able to finally find a solution which helped me, so this should work for you as well.
Try the following:
drag the Search view out of its current position and anchor it in a different place (I dragged it just above the Explorer view on the left)
double click on a search result - it should open in the panel with all other files
next drag the Search view again to anchor it as the bottom panel, and try to open a search result again
You may need to play around with this a few times before it works, but it took me less than a minute to fix.
It seems that the way how you anchor the Search view has influence where the files will open after you double click.
See the original post which helped me find the solution
I fixed this in my variant of Eclipse (MCUXpresso) by altering: Window -> Preferences -> General -> Search -> Reuse editors to show matches.
When I open, say a 10 or more file in Netbans 7.3.1 (windows 7), Netbeans puts each opened file's name in a a tab and all tabs are listed horizontally above the code eduitor. And at the end of that horizontal list, Netbeans provides clickable arrows (>,<,V ) to kind of navigate that list.
Since many times, the file that I want to get into is not visible in that horizontal tab list, and I need to navigate to the left or right, I usually end up clicking on the down arrow (v) and that gives me the full list of all the open files. At that time, it's a simple click to go to that file. I wish that list was available to me in a vertical fashion without an extra step.
Is there a way to see that vertical list at all times? For example, where the HTML navigator is...
I don't believe NetBeans can do this as you describe.
However, what you may find useful is Ctrl-Tab - pressing this once brings up the open file list and pressing Tab repeatedly iterates through these files. Ctrl-Shift-Tab iterates in the other direction. Letting go of Ctrl selects the currently selected file. This is similar to the Alt-Tab feature in Windows.
Hope this is useful.
my Eclipse Juno SR1 somehow got screwed up. It seems I have a new area, and if I interpret it correctly, it is called the "Shared Area" (only from a tooltip). I cannot get rid of it by conventional means (i.E. closing/hiding). All files I open now are opened in this shared area, not in the area my files were opened before. The area is distinct from the normal editing area in that it will not go to the same place (top right, under the menus).
The area has only maximize and minimize buttons. Maximizing it will maximize it over everything, this would be expected. Minimizing it actually hides it, but opening an existing file will bring it back as kind of a popup over the eclipse file list.
I do not seem to find how I activated this feature, and I cannot seem to find any activation instructions in the Eclipse help (the help looking for "shared" and "area" separately doesn't really help anyway).
I just want this feature/window/perspective to go away and let me open files like I used to. Any tips?
Edit: Maybe this area is not called "Shared area", this could be wrong. If not, it doesn't seem to have any name. It just forces all editors opening new files to open in it, and not in the area that they usually open in. The way I determined it was called "Shared area" is by minimizing it, then opening a file. It opens as kind of a popup (described above), and there's a menu bar attached with 2 icons, "Restore" and "Shared area", which is pre-selected.
This is the are "docked" to the right:
This is the area docked below:
The area is not dockable in the way that it docks to certain areas of Eclipse, but stretches (when dragged) over the whole Eclipse Window and even outside of it.
You should reset the perspective Window -> Reset Perspective...
The shared area is the default location to open files. The files remain open in the shared area across different perspectives such as Java and Debug so that you can switch between them while working on the same files. You'd generally drag a file outside the shared area to work on it without it appearing in other perspectives.
It's hard to position the shard area view by dragging it, but you can drag the surrounding views in place around it to get it where you want.
I click on the bottom corner of the offending tile and dragged in till it closed! The "reset perspective" did not work for me but the draggin to a smaller size as if it were a picture did. Hope this helps.
If nothing works out for you, simply go to window -> new Window. Opens up a fresh copy of eclipse with everything loaded up. Even on a restart,loads up like normally it would.
I think I know what you mean. If you drag any view to that "Shared Area" but not to the body but to the header (where the title is supposed to be) the dragged view will occupy completely that "Shared Aread".
Hope that helps.
Here's what worked for me:
Menu > Window > Perspective > Open Perspective > Other > Java(default) > Open
Now I can create a new class that shows on the tab next to my working tab.
Ctrl+Shift+{ to toggle it on or Off.
Ctrl+Shift+W to close both of the area.
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).
I could have sworn I saw it once before in a screencast where someone had the find/replace window docked in their Eclipse environment.
However looking through the list of options in "Window > Show" the closest thing I can find is the Search window.
I find that I use it quite a bit and with larger monitors these days I figure I could afford to have it open in my perspective all the time.
Is this possible?
Thanks.
One poor-man's workaround is to dock a view that you don't need in a part of Eclipse where you want the find/replace view and then place the find/replace dialog on top of that like this:
Clearly this is a huge kludge but it does work.
I am not sure about that, since Fast views are:
icons allowing users to quickly display different views that have been created as fast views
And the search/replace is a Dialog, not a View..
(source: bpsite.net)
(That Dialog box is not like Views, which support editors, also have their own menus. Some views also have their own toolbars.)
The help page mentions:
Fast views are hidden views that can be quickly opened and closed. They work like other views except they do not take up space in your Workbench window.
This might not be an exact answer for the question. But this works like a charm.
Press ctrl + j and keep typing...
Use ctrl + k to go on
Use shift key wherever required.
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.