Visual Studio Code - Tabs (editors) of the same project in multiple screens - visual-studio-code

Using multiple screens I normally place multiple classes (files) in different screens, this helps me a lot while refactoring, checking tests and comparing changes.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor.
I checked the documentation and plugins, but the only way I found, is to open two windows, pointing to the same project (folder) and put those in different screens.
I don't like this solution, that causes also some problem when I watch code changes using TypeScript.
Any suggestion?
I use Windows 10, latest version of VSCode.

A solution is to press CTRL+K and after releasing CTRL, press O.
This will open the current file in a new window.
There are few things I don't like about this solution:
- Drag and Drop does not work
- Create a new instance of VS Code resulting in (for me) 180MB of ram used
- To open the file it takes to me few seconds (quite slow)
- The file remains open in the original window as well
Update 20/03/2019:
There is a feature request you can track here:
https://github.com/Microsoft/vscode/issues/10121
And an explanation about why this is difficult to implement here:
https://github.com/Microsoft/vscode/issues/10121#issuecomment-345770248
Update 20/03/2019:
Another important side effect highlighted by #Mär is that:
the IntelliSense fails to establish references it had when the file
was opened in the window, where the entire project is opened

The easy way but with the same drawbacks. More ram and resources will be used. Is to wrap your project in a folder.
It's the best possible thing. As by now!
=> Duplicate the workspace.
Open the command pannel ctrl+shift+p or F1.
Then write dupl
You'll get that
That's it.
More
If you want to add more folder to the working space.
=> go to File then Add Folder To Workspace
You can add as many as you like.
 Also better more
You can open a new window (ex: ctrl+n)
And then go File > Add Folder To Workspace.
And start adding folders to your new Workspace. You can add any folder, that is already open or not. That's too way great. You can have all the needed folders for example in the second screen.

A little hack I used is to just stretch the editor window to fill both screens and split the view pane between the monitors such that both screens show just one open file.
This is a cheap hack that works without opening multiple instances of VSC.
It may not be the proper solution, but it works without eating up all my system memory.

I found the following way to work on multiple monitors (important: they must be the same size and resolution):
open a visual studio in windowed mode on the 1st monitor (in my case it is a left monitor)
move the window to the (left) top corner
stretch window to the 2nd monitor (right) bottom corner
split screen by clicking “split editor” several times
move the code sections separator to the edge between the monitors
This is old qestion, but such way can be useful for someone. It is not very convenient, but it works. The solution may have already appeared in the VS itself, but I didn't find it.

Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor
Actually, VSCode 1.57 (May 2021, 4 years later) will propose something close:
Improved editor drag and drop across windows
Support for dragging editors to other windows was improved in this release. You can now drag diff editors, custom editors and the entire editor group to another window to open the editors there.

My solution was to use Remote-ssh to connect to self and open in another window. This does take extra resources. But I find this comfortable as I don't need to create additional workspace.

For me on Ubuntu the solution was to create a project folder symlink and ope it in a new window (as it won't open the same folder in another window)

Related

Visual Studio Code explorer view scrolling

My project contains a LOT of folders, many of which I routinely have open, making for a lengthy explorer view. I find scrolling this view quite frustrating for two reasons:
There is no equivalent of the editor.mouseWheelScrollSensitivity setting for the explorer view. I'm also generally happy with the scroll speed for my mouse in other applications, so don't want to go messing with a system wide setting to compensate for VSC.
The scrollbar is frustratingly difficult to grab at and requires precise mouse placement. The number of times I accidentally grab at the slider and resize the view rather than scroll it is ridiculous.
I've found no useful extension to help in this matter. Has anybody any suggestions? I'll raise an enhancement request in Github if necessary.
Here are 2 shortcuts that can speed up navigation between files:
With Ctrl then Tab you can browse a history of your last viewed files. Great for switching around when working on multiple files.
With Ctrl+P (Go to File... command) you can quickly go to a file by name. You can also search for files inside folders like this: folder/subfolder/file.ext. This is great if you know what you are looking for.
Source and more navigation tips: https://code.visualstudio.com/docs/editor/editingevolved#_quick-file-navigation
This PR in vscode 1.59 may have fixed this issue: https://github.com/microsoft/vscode/pull/110059/commits/61efc577e038ac772f12511fb823de27296dbc69
New settings:
workbench.list.mouseWheelScrollSensitivity
workbench.list.fastScrollSensitivity

Multiple editor windows with multiple tabs

Very often I work with multiple projects in MATLAB and have a group of files for each project that I access at one time. Having all files of all projects open causes a lot of clutter in the workspace. One can do this for one single set of files by docking which is well known.
Is there a way to tab projects, or have multiple MATLAB editors (for each project) open with multiple tabs in each (with the projects files). The question can be found here too. In the same vein, are there other code editors which can be used to perform the same?
Project1
file 1.m
file 2.m
file 3.m
file 4.m
Project2
file 1.m
file 2.m
file 3.m
file 4.m
Either in the same window, or in different windows.
Unfortunately I don't believe MATLAB can do that kind of project/file management for you, which is why I use Sublime Text 2. It's perfect for that kind of project/file management... and not to mention the awesome shortcuts and quick editing tools to help you code faster.
Check them out: http://www.sublimetext.com/. The one drawback is that it's nagware. It is free to use, provided you can bare the popups to buy a copy of the software every now and then. Once you buy it, the popups go away. Give it a try and see how it goes!
If someone still need a solution for that-
You can just drag a tab of one file to the side, or bottom of the space of the editor, like that:
And the result will be:
Now you can drag in the same way other tabs to the new tabs group, and you have two separate tabs groups (but one Editor window..). You can of course drag the middle edge line to the right-end, and work fully only with the first group, or drag it to the left-end and work fully with the second one.
Note for one drawback here- if the line is in one of the ends, you don't see the tabs status and files names of the hidden group, and if you forget that you opened some file there and try to open it again, you will not see it opened, or any change in the IDE, because the control goes to the already opened tab but you not see it.

How can I close an empty pane in Eclipse

I often end up with lots of empty panes in Eclipse that can only be minimized but not destroyed. How do I close these?
Update:
In this screenshot you can see two minimized on the upper left and several on the right hand side. In the center are four more. They only seem to be restorable in the Debug mode.
http://img406.imageshack.us/img406/9900/eclipse1.png
this happened to me, too. What worked for me (based on FilmJ and douncon's comments) was to open a class file, then drag that tab over the top of the empty pane.
Select Window -> Reset Perspective. That should reset the current perspective (what you call "mode") to its' initial state, (hopefully) closing all irrelevant views.
Something seems terribly wrong with your Eclipse. Maybe you should reinstall it. It is possible that you installed a buggy plugin.
First of all, what do you mean by pane? Eclipse has:
Windows (Eclipse itself, e.g. instance)
Documents (tabs)
Views (properties, tasks, explorer, etc)
If by 'pane' you mean document editors, you have problems either with your Eclipse version or most likely one of the installed plugins.
Each View also can be closed (except maybe some project types (perspectives) of which I'm not aware). For CDT (C/C++) you can close practically everything.
I'll recommend you download latest Eclipse version with no plugins, extract it to different folder, and check if that happens again. If yes, please explain more in details (like Eclipse version, perspective you are using, any side plugins, etc).
Also a good places are Eclipse community forum, mailing list and bugz :-)
I had the same problem. For me it helped to go into the right perspective and activate the functionality that caused the window in the first place. Once I reactivated the functionality, in my case "QNX Memory Analysis perspective", I was able to close all the windows one by one.
The conclusion is you have to refill the empty windows with content and then you will be able to close them properly.
So, it's really very easy for this to happen, if you open an editor that's incompatible with the existing editor, you can often end up having to place it outside of the tab list in one of your editor panes, then you might clear or copy that, typically while trying to add that view to a tab list.
In any case, what it's done is create a new editor, and all you need to do is drag some file to that empty editor window giving it some form of context, then close it.
I had the same issue. I followed #zvikico, but instead of just resetting, I first reset and then closed all the perspectives. Please follow the following to fix the problem. It worked for me:
Window -> Perspective -> Reset perspective..
After resetting follow below:
Window -> Perspective -> Close All Perspectives

Eclipse: Nested Editor Tabs?

Is anyone aware of any method (or external plugin) that would allow for nested editor tabs? It would be nice to be able to group related open files into their own "master" tabs, but I'm not sure if this is even possible. Any ideas?
This is totally non-obvious, and I discovered it by accident, but...
If you click on a tab and start dragging it downwards, once you get more than half-way down the editor pane, a horizontal line will appear. Let go, and now you'll have two different editor panes, each with tabs of documents. Now you can drag tabs up and down between the two panes to see different documents at the same time.
I think that's as close as you can get.
I think the best you can currently do is "Window->New Window" and then use each new window as a separate "tab" of related editors. Not exactly ideal, I admit.
It's a cool idea though, especially if you could have shortcuts or something that open groups of editors with a single command.
This definitely isn't possible in the current RCP. You might be able to construct an editor component which created a CTabFolder and delegated to other editor components, but I'm not sure how well that would work.
There are Perspectives in Eclipse that you might use to achieve something close, they are more global things though...
But I agree with you, I would like this feature as well! This would be also very useful when editing many files that have the same name but come from different packages, because now it's a mess >_<
For me the utility of such a feature is to reduce context switching time. I'm working on project A, have lots of editors open, now I need to drop that and work on project B. I want to keep all the editors open associated with project A but hide them while I work on B. When I'm done with B, I can pick up right where I left off in A without having to find and open all those A files again; I can even leave them unsaved indefinitely, since Juno never crashes!! :)
I have used the New Window feature, and it's great, but the new window needs a bunch of configuration (closing Views I don't need, moving stuff around to where I want it, opening Views I had open in the old window, and so on) before I can get to work. It also uses a lot more memory than a simple tab group would since it seems to be a complete new copy of Eclipse.
The split-window feature is great and I use it all the time. It is indeed tab groups, and if there were a way to hide a tab group, and for each tab group to have its own tab list (the thing you get when you click ">>5" so you can see editors you have open that don't fit in the tab header), it would totally fill the bill.

Source Editor Tab order in Netbeans 6.5

I recently switched to Netbeans from Eclipse, and the one thing that I liked about Eclipse I'd like to get in Netbeans:
The order of the tabs at the top of the Source Editor in Eclipse seems to be related to most recently used, so if I have a group of 5 files I'm working on at one time, they are all likely to be visible in the tab list, no matter how many tabs I have open.
In Netbeans, this isn't the case - I don't know what the order is, but it isn't useful for switching between my active files quickly - its usually faster to re-open the file to switch to the correct tab than to actually use the tab system.
Is there an option setting or a plugin that can change this behavior to something more like Eclipse?
By default the tabs in NetBeans are ordered acording to when they were opened. I don't think there's a way how to change it right in NetBeans and don't know about any plugin neither. I think this behaviour is just a matter of taste - I was used to NetBeans behaviour and when I'm using Eclipse, I always get confused about shuffled tabs. But as Kevin said you can drag the tabs to change their order.
When you press CTRL + TAB, the documents in the popup window are ordered acording to last used. This might be usefull for you.
Another (partial) solution might be docking a documents window (Window -> Documents) which contains opened documents and where documents are ordered alphabetically. It's better than re-openenig the files (as you wrote) especially if youre files are spread in different packages and you can't see them in projects/files view on one screen.
I don't think it does. However, you can drag the tabs to the positions you want them in. I would suggest just ordering by your liking manually.