Eclipse - easy access to frequently used folders?

后端 未结 5 944
广开言路
广开言路 2021-02-07 04:56

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

5条回答
  •  抹茶落季
    2021-02-07 05:18

    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
    2. With Focus on Active Task selected in Eclipse's Project Explorer...
      1. Run touch (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 to push a new directory onto the stack (and cd into it)

提交回复
热议问题