Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 837
Norcino Avatar asked Nov 13 '17 09:11

Norcino


People also ask

How do you keep tabs open in VS Code?

Open settings file by: Preferences: Open Settings (JSON) Under user setting, enable Tabs by: "workbench. editor. showTabs": true.


2 Answers

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

like image 126
Norcino Avatar answered Nov 08 '22 08:11

Norcino


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 enter image description here

That's it.

More

If you want to add more folder to the working space. => go to File then Add Folder To Workspace enter image description here 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.

Happy coding.

like image 27
Mohamed Allal Avatar answered Nov 08 '22 09:11

Mohamed Allal