vscode: is there a way to assign each project root in a workspace to it's own side of a split view? - visual-studio-code

I have two projects in one workspace. I want to be able to compare the projects by assigning each project to a side of a split editor in one workspace window. So all files from one project would launch on the left side and the other projet's files on the right side. Can this be done?

Related

Is there a way in Eclipse to organize projects into folders?

The new folder command seems to create a folder within a folder. I have so many projects that they are hard to organize by name only. Is there an Eclipse better way?
You can't put projects in to folders.
You can change the Package and Project explorer views to show 'Working Sets' as the top level elements in the view (use the view menu 'Top Level Elements' to do this - the view menu is the small down arrow at the top right of the view window).

Is it possible to duplicate the view of the same source file in Eclipse?

I'm doing some manteinance to a .cpp file with eclipse and I need to compare two methods. It's very uncomfortable to jump ahead and back to check differences.
Is there a way to duplicate the view of the same source file, in order to compare them side by side?
Edit the file and use Window > New Editor to open a second editor on the file. Then drag the title tab of the second editor and Eclipse will show on outline of how it is going to arrange the two editors. You can arrange the two editors vertically or horizontally.
Update:
Eclipse 4.4 Luna (currently only available as Milestone builds) adds support for splitting the editor directly using Ctrl+_ and Ctrl+{.

How to compare two files in Eclipse?

I want to compare two files. One is in the current project and the other is in the backup directory. I know how to compare if they were in the same project.
How can I compare in Eclipse?
And what is Flex navigator in Eclipse?
Open the Navigator with the Main menu: Window->Show View->Navigator.
You can select two or more files in the Navigator using Ctrl-click, or Command-click in OSX. Now Right-click any one of the selected files, and select the menu item: Compare With->Each Other.
The problem is that your alternate file might not be in the Navigator, e.g. your backup directory isn't listed in the Navigator. If not, Right-click in the Navigator and choose the menu item: New->Folder. In the resulting dialog click the Advanced>> button beneath the Folder Name field, choose Link to alternate location (Linked Folder), and browse to add your backup directory.
Now using the Navigator you'll be able to select the two files, and use Compare With.
You can similarly compare files using e.g. the Package Explorer.

Save open files (session) in NetBeans

I would like to save actually open files (tabs) and revert session (group of files) next time. Is there any options in NetBeans IDE 7.1.2? I know that NetBeans save automatically list of files that were opened when I quit the IDE. How to save opened files and switch between sessions?
You are looking for Project Groups. Take a look at the File > Project Group menu.
There you can create Project Groups that defines a list of opened projects. You can then switch from groups and the chosen projects will be opened/closed.
Netbeans saves the list of opened files per project so:
if your groups do not share projects, you'll get the behaviour you want.
if your groups share projects, the files opened in theses projects will follow you when switching between the groups.
<3 Netbeans
Try Tab Groups.
In Netbeans (at least in version 7.3.1), click:
Window > Configure Window > New Document Tab Group
Now, open a new file and it should open in a separate window.
Then, you can toggle the Maximize Window / Restore Window buttons to switch between your windows / tab groups.
Restore Window Button
Maximize Window Button
This is a convenient way to switch between sets of files, although you technically aren't saving these sets as you asked in your question. It does remember these tab groups when you close and reopen Netbeans, though.

Eclipse Shortcut for Team - Synchronize with Repository

What are the shortcuts for the context menu actions "Team -> Synchronize with Repository" and "Team -> Update" on the whole project?
I have already found shortcuts, but these are executed only on the file i have currently opened. But I want to execute it on the whole project without having to scroll the project explorer to the top and right-clicking on the project.
If there are no such shortcuts, how can I create them?
As john.k.doe indicates, that's the right solution, but you also need to do something else in order to make the shortcut actually work, which is go to Window > Customize Perspective > Command Groups Availability and there just check the SVN box ;)
you can almost always get the key shortcuts you want by
go to preferences type "keys" or go to General -> Keys
in the field presented when you click on "Keys"
in the left pane, type the command you are interested in setting up a shortcut for:
the image below is from my mac, but it works the same way on windows/linux, you just might choose something besides Cmd-Y as your shortcut modifier. the U under User indicates that i was the one to add that modification.
I have written a small Eclipse plug-in which selects the active project in the Package Explorer so you can execute other actions (like 'Sync with repo' and 'Update') on it. I think this approach is more flexible compared to writing a plug-in that selects the project and executes a predefined action.
You can get the plug-in at http://code.google.com/a/eclipselabs.org/p/eclipse-tweaks/downloads/list, it is named "com.xakcop.select". Download it and put it in the dropins/ folder of your Eclipse installation. Then when you restart Eclipse, you will find a new command Select project in Windows->Preferences->Keys. The default key binding is Ctrl+Shift+Backspace but you can change it to whatever you want.
When you are in the Java editor just press Ctrl+Shift+Backspace, this will select the project that the current file belongs to in Package Explorer. Then press the shortcut for "Synchronize with repository" and you are done.
The source code of the plug-in is also available as part of my eclipse-tweaks project: http://code.google.com/a/eclipselabs.org/p/eclipse-tweaks/source/browse/com.xakcop.select
I think the answer to this question adresses the issue.
The quickest way I've found to update/synchronize, after having set the shortcut keys, is to click on the minimize button in the Project/Package Explorer and then press the keys. After the update, simply clicking on the last used file in the editor returns to the previous workspace state (provided the "Link with Editor" button in Project Explorer is selected).
I should clarify: I use a working set for each project. The working sets are displayed as default Top Level Elements in the Package Explorer so, by clicking on the minimize button the desired Project' working set, they collapse and are easy to select. Then, I apply the shortcut on the selected working set.
From my point of view, the problem is the focus of the commands you execute.
The Team commands Snychronize and Update are executed on the current object (In my case). As you noticed, when you execute the command on the project, the project is synchonized - when you do it on a file, only the file is synchronized.
What I did as workaround is the following:
I created Key-Bindings for the commands Show in (Navigator) (Alt-N), Go to (Alt-G), and Show View (Naviator) (CTRL+SHIFT+Q, N).
With Alt-N I show the current File in the Navigator. I can then use the keys to navigate to the root that I want to synchronize (it's not always the whole project for me). If the root is to far away I use Alt-G and type the Project or Folder where I want to go to and execute afterwards the Synchronize commands.
(Go to works only in the current view)
If you have selected the Project once you just have to switch to the navigator (Show View command) and execute your synchronize commands.
You could also use rgerganov's plugin then you would not have to execute as many commands.
The procedure works also with other views (package explorer, project explorer)
What about this approach? It should also work for other SCM's or commands you want to execute on any object in the explorer views.