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...
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).
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.
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
Open a view like Project Expoler, Navigator or PHPExplore (if you
have PDT) or Package Explorer (if you are a java coder)
Click "View Menu" (small triangle icon) at top-right of the view opened
Select "Select Working Set..."
Choose "Selected Working Sets" option
Click button "New"
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"
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.
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.
In a bash prompt, run: eclipse <file_to_add>
With Focus on Active Task selected in Eclipse's Project Explorer...
Run touch <file_to_add> (either create a new file, or update timestamp of existing file)
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)
Related
My current workspace shows this directory. I would like to remove it so it doesn't appear in my workspace.
According to the documentation that I've read the way to do this is to go to File->Preferenceces -> Workspace Tab and the Add a pattern in the excludes.
However, no pattern that I've tried has worked.
I've tried
**/IVAPI/BKP_OLD_CODE/*
**/BKP_OLD_CODE/*
**/*BKP_OLD_CODE*
**/BKP_OLD_CODE
Then I click the refresh button on the worksapce explorer but the directory stills shows up. How can I add a patter so that BKP_OLD_CODE does not show up anymore?
You were very close, the fact is that, since its a folder, it does not have an extension or prefix! So just use the name of the folder (BKP_OLD_CODE in this case) and you are all done!
When I bring up VS Code I see options for adding a file or folder but I do not see options to delete a file or folder or rename such. Any hints?
Deleting file is strait forward. To delete a folder created using MS Code explorer,
press Ctrl + Shift + P then it will show a command prompt like
section at top.
Search 'remove' in that. A command will be shown -"Workspaces: Remove folder from workspace...". Click on that.
Intended folder name will be shown for removing.
After clicking the same, it will be removed from explorer, without affecting actual
files on the operating file system.
Thank you I figured it out. It doesn't seem immediately obvious to me but on a MAC using VSCode selecting a file and entering the return key lets you rename a file, selecting a file and then using command-del deletes a file.
The Rename and Delete actions are there, but you have to select the file in the bottom part of Explorer, under the project directory. When you select it under Open Editors or right click on the tab bar, there is no Delete and that is confusing. In this case you can choose Reveal in Side bar in the tab context menu to get to that entry. But that won't help (will select the tab under Open Editors) if the file is out of the project tree, in this case the most convenient action would probably be to Open Containing Folder and delete it manually in the file manager.
Using extension:
Install File Utils extension
https://marketplace.visualstudio.com/items?itemName=sleistner.vscode-fileutils
Press Ctr + Shift + P
Type File Utils > Delete
In VSCode, make sure you are in Explorer. Also make sure you are right-clicking the file shown in the directory/folder. Here either hitting Del for windows and command+del for Mac will delete the file.
A common issue is trying to delete a file when in source control. You must be in explorer.
VSCode 1.50 (Sept 2020) still has the feature for file deletion, and improves it with microsoft/vscode issue 71315
##Should maintain row focus after deleting a file
Use case:
Use the keyboard to focus a file in the explorer and delete it
Now the whole tree has focus
Press the down arrow key
The first item is selected
I want to get back to where I was looking before.
The search tree focuses the next item in the list when one is removed.
I don't know whether the explorer did this previously with the old tree. But it would be nice for the explorer to do the same thing.
Just right click on the file or folder you will get the options to delete the file as well as of renaming the file.
For directory delete type in VScode terminal:
rm -r directoryName
For file delete type in VScode terminal:
rm fileName.tx
No way to delete a folder by a right-click. However, you may remove it from the IDE: File > Close Folder.
I have the same set of files in N folders, one of them, say, blank.xhtml. The files contain somewhat similar information and it is becoming overwhelming to figure out which file comes from which folder every time I switch between the tabs. When I open one of them to edit and happen to open a file with the same name from another folder I get confused and more often than not end up editing the wrong file: nullifying my hard work. So I am wondering if there is a way to show the name of a containing folder in the tab like this G-06/blank.xhtml or G-07/blank.xhtml. I will be very very thankful to anybody who has pointers to how I can make this happen.
As an addition to the Maroun's answer there is an alternative solution.
It's not exactly what you want (full name in the tab's title), but may be useful sometimes.
In the "Project Explore" view (the same goes to "Navigator" view) click the "Link with Editor" button. That way, whenever you choose some file opened in the editor, it will be automatically selected/highlighted (see the picture) in the "Project Explorer" view.
Here is the picture:
Maybe this will be useful to you too.
If you hover the mouse over the tab containing the file name then a popup appears showing the full path. Not exactly what you wanted, but it should help. (This with Eclipse Neon.3 Release 4.6.3 on a Mac).
Not quite what you're looking for, but ctrl+shft+e will open the switch editor window that shows all the open editors with their filepaths. I use this shortcut for the same reason. I'll have multiple build.gradle files open from multiple projects and this helps pick the correct one
Okay, I have another newbie question. I'm starting to work with a remote code repository, remotehosting.com, and have been given a username, password, and URL. I've been able to successfully associate my project with a remote source code repository, have checked out/pulled down the source files, and have now made a small change to a single file. Here's where my questions start.
1) I can't see anywhere in my GUI where Xcode realizes that I have made a change to a file
2) How do I check my files back in?
I gotta be missing something. The docs I've been reading point to more menu items that I currently see under my SCM menu item. Anybody have any ideas? Thanks in advance for your assistance!!!
File -> Source Control -> Commit, Select the files that you want to commit, add a comment and hit commit button.
This is the flow for xcode 4
In Xcode 3...
The Project window should have a column which displays the SCM status for your files. This can appear both in the "Groups & Files" outline view in the left pane and the file list in the right pane. The icon for the column is a little cylinder shape, a black-and-white version of the yellow cylinder that's shown when you manage repositories. If this column is not displayed, you can right-click on the header of either of those panes to bring up a menu with a list of columns. Select "SCM" from that. The status will display as the same one-letter codes that SVN uses on the command line.
In order to commit files, you can either a) select the particular files, or group you want to commit and use the menu command SCM>Commit Changes..., or b) Select SCM>Commit Entire Project... (which I personally have bound to ⌥-⌘-C in the Xcode key bindings preferences).
Either of these will display a sheet in which you can enter your commit message; the text field in this is very handy in that it accepts the Return key as a newline, rather than passing it to the "Commit" button, but could be confusing the first few times. Press ⌘-Return to activate the button and perform the commit.
I will need to use multiple workspaces for a recent project. Each workspace might consist of 10 or more projects.
When I'm switching between various applications and different eclipse instances(for the multiple workspaces), I want to be able to distinguish a given workspace easily without having to spend 5 seconds to know from the open file, etc.
What facilities are available to quickly know which workspace I'm in ?
Use the -showlocation command line argument when starting Eclipse. This shows the current workspace name in the window's title. You can also put the argument in the eclipse.ini file.
You can also add your own window title in:
eclipse preferences > workspace > workspace name (shown in window title)
Explained here: http://eclipse.dzone.com/articles/show-workspace-location-title
-showlocation is great, but it only changes the text at the end of the title bar, so it's often not visible in the taskbar.
If you want to change the beginning of the title bar, which shows the current Perspective, you can use Window -> Save Perspective As... and the new title will be visible in the Taskbar.
You could use also the OS for this to setup different workspaces, with diff, background or so. Where you have in each workspace a Eclipse running, with a diff workspace.
You can also create different working sets in the same workspace. The you only need one eclipse and switch between working sets in 1 sec depending on the mouse speed :)