How to make Matlab editor open a new script as a tab by default, instead of a new window? - matlab

I'm used to using tabs rather than having many new windows open. I've recently changed (work) computers and now whenever I open an old script or start writing a new one it opens a new instance of the matlab editor. The question is, does anybody know how to change the default to a new tab within the same editor? (hope that makes sense).
Thanks

Open 2 scripts or more. On one of the editor windows press the circled triangle (I am sure it has a proper name):
Select Dock All in Editor.
The files should appear as tabs docked to the matlab desktop.
You can now undock the editor using the same button (you should undock the editor, not a specific file)
Any file you open now should be in a new tab.

Related

How to run VS code on more than one monitor?

I'm still new to VS code and I saw this type of using VS code on two monitors, so I have 3 monitors and I'm on windows 10, I use the left one as a preview for the code I'm typing in chrome so that is sorted and I want my middle one to have the main code I'm working on and my right one is set vertically so I want it to run the terminal or of that file or another file so I can use both my right and middle to write code and I have no idea how can I do this.
there is a workaround, first in the file you want to open go and click ctrl+shift+p and search for open active file in new window, then in your new instance, press again ctrl+shit+p and search for Open User Settings(JSON) and add this line at the end of the settings "files.autoSave": "onFocusChange", so whenever you change windows the current file you're working on will be auto saved, hope this helps

VSCode - Open terminals in a separate window

in VSCode is it possible to open the terminals in a separate window?
So far my research has pointed to a resounding NO but Im curious if anyone has a solution?
Move terminals between windows
It's now possible to move terminals between windows by detaching via
Terminal: Detach Session in one and attaching to another with
Terminal: Attach to Session. In the future this should help enable
cross-window drag and drop!
Lots of changes in v1.58: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_58.md#terminals-in-the-editor-area
For v1.59 moving the terminal changes - including dragging and dropping onto another window, see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#drag-and-drop-terminals-across-windows
Drag and drop terminals across windows
Drag terminals from the tabs
list or editor area of one window into the tabs list, editor area, or
panel of another window.
Terminals in the editor area
Terminals can now be created in or moved to the editor area, enabling a multi-dimensional grid layout that persists and remains visible regardless of panel state.
To use terminals in the editor area, there are several options:
Create via the Create Terminal in Editor Area command.
Move a terminal from the panel to the editor by dragging and dropping from the tabs list.
Running Move Terminal into Editor Area with a terminal focused.
Moving into the editor area via the terminal tab context menu action.
The new terminal.integrated.defaultLocation setting can be set to editor to direct newly created terminals to the editor area by default.
Please Try:
File > Open New Window
Ctrl+Shift+P > Terminal: Create New Terminal in Editor Area
You can add keybinding to the commands as per your convenience.
i think that the OP wants to create a separate window for the terminal but still have the separated terminal linked to the code editor in the original window (that's what i want too). so that when you run the code in the editor the output is shown in the terminal in the separate window. but if you simply open up a new window of vscode and either open a terminal there or drag and drop the terminal from the original window into the new window, the new terminal is not the same session of the terminal. it is a separate independent unconnected terminal. running the code in the editor does not show output in the new separate terminal. all you have achieved is creating a new unconnected terminal. which you could have just accomplished by opening up a regular terminal window i.e. the one from windows os main menu, no need even to use vscode.
This answer is now outdated. See this answer for instructions on moving terminal panes between VS Code windows. This answer still works but is no longer a necessary workaround.
You can't detach the panes in VSCode, which IMO is a bit of a pain since Visual Studio can detach panes all day long.
There is a workaround though, you can open a new window in VSCode and maximize the terminal pane in that window.
One reason you'd want to do this is to have the Python terminal on a second monitor while still being able to use Python interactively (shift+enter way). Attaching/detaching didn't work for me, nor can you open separate terminals.
What you can do is simply resize your one window across the screen borders! Then right click on the terminal tab/header and click Move panel to the left and voila!
Try Сtrl+Shift+c.
For me, it opens the folder the script is within in a command prompt window.
Create a new window by going to File → New Window.
Open up a new terminal inside of it.
Go to your folder (cd your\projectfolder\path).
And here you are, you have a terminal for your project inside it's own seperate window.
You can change the terminal to be side-by-side instead of below the editor. And then make your window very wide. It is almost as good as having two windows.
Right click on the TERMINAL tab.
Select "Move Views to Side Panel"
Make your window very wide
It seems VS Code allows you to detach the terminal window, but it then will not show the output from the editor of the window you detached it from.
I have spent a while searching, and there is really no workaround other than to just run whatever file you are trying to debug from a separate terminal from the same CWD. This also means you will need to save the file in the window you are editing the file in every time you want to run it. huge pain.
If you are using PowerShell inside the VSCode terminal, why don't you use the PowerShell console from the start menu. It's basically equivalent to using the terminal in separate windows. Hope it helps.Sample

In Eclipse, is there a short cut key to open a editor in a New Window?

I am editing a .java file in eclipse, is there a short cut key to launch/open the current .java file I am editing into a new window to make use of my multiple displays?
I am using Eclipse 3.x
There is no shortcut key in Eclipse to reopen a file in a new window, but I'm unclear on how that would work anyway. Maybe I'm missing something, but how would Eclipse know which display to use, where to position the new window on the display, and what dimensions to use for the new window? And even if it did know how to do all that, it's not improbable that you would still want to adjust the size and positioning of the new window.
Besides, there already is a better alternative to a shortcut key: just position the mouse cursor over the tab of the open file, drag it to wherever you want on any of your displays, and optionally resize that new window as desired. The change will persist over restarts of Eclipse.
(I verified this on the latest release of Eclipse, Oxygen.2 Release 4.7.2, but I don't know when that drag and drop functionality was first implemented.)

MATLAB editor does not work after using `matlab-emacs`

My MATLAB editor stopped working. I'm not able to open any file via UI or command (edit file.m). It all started when I was editing a script using matlab-emacs.
I found a workaround to open files, but it is annoying. First, I need to click with the right button of the mouse in the file I want to open. Then, I select Compare against > Choose. Clicking in one of the line numbers in the left panel opens the MATLAB editor. Once I'm in the editor, I can open any other file by choosing File > Open as Text.... I also tried reinstalling MATLAB, but the problem remained.
I am using MATLAB R2011a and Ubuntu 11.10.
I spent a big amount of time reinstalling it, when it was far more simple.
Select File > Preferences...
In Editor/Debugger, my editor was set as a blank Text editor, instead of MATLAB Editor.
Just pick MATLAB Editor in the radio button.
matlab-emacs extension probably changed my settings.

How do you make new editors open in another screen?

I use dual monitor for work and I prefer to have the editor on my main screen while the rest of eclipse in my laptop monitor.
However, when I open a new file, that is. I open a file with Cmd-Shift-R, files are opened in my laptop monitor as opposed to the editor that I dragged to my main screen.
I find this mildly annoying. Any ideas?
Are using the Window -> New Window feature? In that case it depends on which window you're working on at the time you press Ctrl+Shift+R.
However, if you're streching only one Eclipse window along both monitors, then the Open Resource dialog will be opened in your "monitor number 1" (and that depends on your graphic configuration: Laptop+Main or Main+Laptop).
I found easier to avoid the new window menu and just to drag those views out of eclipse. This creates a secondary window but the project explorer is linked to the old window so double click will open the file on the main window.
I recommend to save everything as a new perspective that I usually call "Java 2 Windows". This way I can change perspectives when I do not have an auxiliar screen.
P.S. Just avoid closing the auxiliar window when leaving eclipse.