Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matlab keyboard shortcut: move cursor from editor to command window

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.

like image 683
ZYX Avatar asked Mar 14 '14 07:03

ZYX


People also ask

How do you get to the command window from the editor in MATLAB?

Just press Ctrl+Shift+D in the editor window.

What is the shortcut key for move to command?

Press the TAB key to move to the Commands box. Press DOWN ARROW or UP ARROW to select the name of the command or other item that you want to assign a keyboard shortcut to or remove a keyboard shortcut from.

What is Ctrl R in MATLAB?

Comment/Uncomment Windows: Ctrl + R/Ctrl + T. Mac: ⌘ + / and ⌘ + T. Comments are an essential component of any code.


2 Answers

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.

like image 51
marsei Avatar answered Sep 17 '22 23:09

marsei


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.

like image 34
Divakar Avatar answered Sep 19 '22 23:09

Divakar