Question

Is there a keyboard shortcut in matlab to move cursor from the editor to command window? I want to achieve something similar to the effect of Emacs shortcut Ctrl + x, o which moves cursor between editor windows.

Was it helpful?

Solution 2

On Linux and Windows (tested), unless MATLAB preferences are modified, if you have the editor window docked, then according to the default settings, Ctrl+Tab would get you from Editor to Command Window and from there to go back to Editor, you would need Ctrl+Shift+Tab.

If you are coming from Emacs background and would like to use a similar environment for using MATLAB without the graphical user interfaces, you can choose to launch MATLAB without desktop with the command matlab -nodesktop, when you have the matlab executable in PATH. You can open two Emacs windows, with one to edit codes that will simulate your MATLAB editor and the other one would has MATLAB command prompt, simulating the MATLAB command window.

If you would like to work with MATLAB graphical user interfaces and keep on using the Emacs shortcuts for editing in MATLAB editor, you may go to Preferences> Keyboard Shortcuts Preferences and under the popup menu Active settings, set the option as Emacs Default Set.

You may find more info on launching MATLAB without desktops here.

OTHER TIPS

On both Mac and Windows (use Ctrl instead of CMD below for Windows), it is

  • CMD + 0 to go to the command window
  • CMD + SHIFT + 0 to go to the editor
  • CMD + 1 to go to the command history
  • CMD + 2 to go to the current folder
  • CMD + 3 to go to the workspace

The shortcuts of your system are displayed when you click on the quick access toolbar (top right), windows icon. They are not visible in the preference settings of MATLAB.

There are 2 ways to do on a windows machine:

1) From anywhere in a MATLAB window, use

  • Ctrl+0 to go to command window
  • Ctrl+Shift+0 to go to editor window.

2) If you have many tiles (like commnad window, editor, Workspace, command History etc.) then using Ctrl+tab will roll you through each tile on every press of Ctrl+tab.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top