19

Does anyone know of a plugin for Eclipse to use 'favorite folders' in a project ?

There are maybe 2 or 3 folders inside my project (of 1000+ folders) that I regularly switch between. It's really a drag to use the scrollbar in the Project Explorer each time to get to the right folder, since some of them are 5 levels deep in the directory tree.

It would be VERY nice to have a separate small panel below the Project Explorer to access these frequently used folders...

Dylan
  • 9,129
  • 20
  • 96
  • 153

5 Answers5

10

Eclipse now allows to bookmark folders -- the corresponding bug is fixed.

When you select a folder in the tree, the add option might not appear in the context menu, but it does appear in the application menu at Edit -› Add Bookmark.

However, while the folder then is listed in the bookmarks view, nothing happens when it gets clicked. One has to right-click the bookmark and then select Show in... to get the actual folder focused in the navigator/explorer. IMHO it is better (i.e. more robust) than the workaround using file-bases bookmarks, but it still could be improved (e.g. without the context menu extra clicks to switch to a bookmarked folder).

Oben Sonne
  • 9,893
  • 2
  • 40
  • 61
  • Yes, but you can't jump to a bookmarked directory by a doubleclick... it must "right click -> show in -> package explorer"... I would be so glad to find the person who "invented" this wonderful feature and ask him, what he thought as he wrote it so... – peterh Apr 19 '16 at 11:17
7

At this point, looks like https://stackoverflow.com/a/12365878/470838 is more relevant than this answer.

Note quite what you want, but Eclipse allows you to bookmark files. You could use this to bookmark a file in each directory and then use the Bookmarks view to move around from there.

orangepips
  • 9,891
  • 6
  • 33
  • 57
  • see @Oben Sonne's answer below for how to make it work with bookmarks – Renaud Apr 17 '13 at 11:03
  • Well, I am not really astonished by this feature (f.e. you can't make bookmarks for directories), but at least it exists. – peterh Apr 19 '16 at 11:16
  • Maybe we can update the answer, Eclipse allows since a long time to bookmark also folders. – vogella Nov 23 '17 at 11:36
5

This topic may be old, but I think this solution is good enough

Use "Working set" feature to group files/folders you need into a working set

Create a working set

  1. Open a view like Project Expoler, Navigator or PHPExplore (if you have PDT) or Package Explorer (if you are a java coder)
  2. Click "View Menu" (small triangle icon) at top-right of the view opened
  3. Select "Select Working Set..."
  4. Choose "Selected Working Sets" option
  5. Click button "New"
  6. Pick a type you need, click next, give it a name (eg: MyBookmark) and choose any project(s)/folder(s)/file(s) shown under "Working set content" to include in MyBookmark and finish

Open/edit/close a working set

  • To open a working set (MyBookmark), follow steps 1 -> 4 above and check the checkbox named MyBookmark, click OK. Now the view display only contents of MyBookmark
  • To edit MyBookmark contents click "View Menu" and select "Edit Active Working Set..."
  • To close current working set and back to original display click "View Menu" and select "Deselect Working Set"
trungnnh
  • 263
  • 2
  • 7
2

I would really recommend Mylyn (a task-focused interface) for this kind of workflow.

By defining the appropriate task context, you could switch to such tasks and see only the folders you need (no dragging involved) as opposed to see everything.

alt text

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Mylyn is great! However, I don't think that it solves the problem of setting up an initial task context to include your **most used** folders. Each time I activate a brand new task, I would like to be able to have the folders that I most commonly work in to be automatically added to the task context, without having to copy them from another task. – TrinitronX Sep 21 '11 at 18:11
1

To add to VonC's answer:

Adding files into Mylyn's current task context using Bash

Currently there are two main ways I have found to manually add certain files into the activated Mylyn task context when you activate a new task. This works well for me because I always have a prompt open or accessible at a keypress.

  1. In a bash prompt, run: eclipse <file_to_add>
  2. With Focus on Active Task selected in Eclipse's Project Explorer...
    1. Run touch <file_to_add> (either create a new file, or update timestamp of existing file)
    2. In Eclipse, click on your project and press F5 to Refresh. The file should show up.

The first one will open the file you want to work on in Eclipse, and it will show the file in the task context. The second one forces Eclipse to see that the file was accessed, and it will add it to your task context.

Setting up commonly used directories in Bash

To solve the problem of having to cd into your most commonly used folders all the time, use bash's built in directory stack feature.

Create a script (preferably in your personal home bin) called sh.init

Add something like this to the file:

pushd ~/src/some/seldomly/used/path
pushd ~/src/some/less-seldomly/used/path
pushd ~/src/some/commonly/used/path
pushd ~/src/some/most-commonly/used/path

Make sure to chmod +x sh.init. (I added this into a function in my .bashrc myself that does a couple other things, but a separate script is probably easiest.) Now run this script whenever you want to add these dirs into your directory stack, and end up in the last one. There is a good tutorial on how to use these functions here or in the bash man page ( Look for dirs under Shell Builtin Commands section). You will always be in the directory on the top of the stack. Here are some quick tips:

  • Use dirs to display the stack ( will display on one line. Top = left, Bottom = right )
  • Use dirs -v to display the stack in multiple lines with numbering ( makes top / bottom order make more sense graphically )
  • To switch the top 2 directories, run pushd
  • To cd into the third or fourth dir from the left, (effectively rotate the stack) use pushd +2 or pushd +3 respectively.
  • These general rules apply when rotating the stack:
    • Numbering always starts from 0
    • If counting n dirs from the top (left), use +n
    • If counting n dirs from the bottom (right), use -n
  • Use popd to pop a directory off the stack, and cd into the new top dir on stack
    • Use dirs +n or dirs -n to display the n'th dir from the top (left) or right (bottom) of stack.
  • Use pushd <new_dir> to push a new directory onto the stack (and cd into it)
TrinitronX
  • 4,959
  • 3
  • 39
  • 66