Desktop Tools and Development Environment Previous page   Next Page

Keyboard Shortcuts in the Command Window

Following is the list of arrow and control keys that serve as shortcuts for using the Command Window. In addition to these shortcut keys (sometimes called hot keys), you can use shortcuts for menu items, which you can view on the menus, as well as general desktop shortcuts described in Keyboard Shortcuts (Accelerators) and Mnemonics. If you select the Emacs (MATLAB standard) preference for keybindings (see Command Line Key Bindings for an explanation), you can also use the Ctrl+key combinations shown in the table.

Key
Control Key for Emacs (MATLAB standard) Preference
Operation 
Up arrow key
Ctrl+P
Recall previous line--for details, see Recalling Previous Lines. See also Command History, which is a log of previously used functions, and Keeping a Session Log.
With the Accessibility preference selected, moves the cursor up a line when it is above the prompt. In that event, use Ctrl+Up arrow key to recall previous lines for Windows and Macintosh key bindings.
Down arrow key
Ctrl+N
Recall next line--for details, see Recalling Previous Lines. Works only after using the up arrow or Ctrl+P.
With the Accessibility preference selected, moves the cursor down a line when it is above the prompt. In that event, use Ctrl+Down arrow key to recall previous lines for Windows and Macintosh key bindings.
Ctrl+Home
None
Move to top of Command Window.
Ctrl+End
None
Move to end of Command Window.
Left arrow key
Ctrl+B
Move back one character.
Right arrow key
Ctrl+F
Move forward one character.
Ctrl+Left arrow key
None
Move left one word.
Ctrl+Right arrow key
None
Move right one word.
Home
Ctrl+A
Move to beginning of current statement.
End
Ctrl+E
Move to end of current statement.
Esc
Ctrl+U
Clear the command line when cursor is at the command line. Otherwise, move cursor to command line.
Delete
Ctrl+D
Delete character at cursor in command line.
Backspace
Ctrl+H
Delete character before cursor in command line.
None
Ctrl+K
Cut contents (kill) from cursor to end of command line.
Insert
None
Change to overwrite mode from insert mode, or change to insert mode from overwrite mode. View current mode in the status bar: OVR is gray for insert mode. In overwrite mode, what you type replaces existing text and the cursor is a wide block.
Shift+Home
None
Select from cursor to beginning of line.
Shift+End
None
Select from cursor to end of last line. Can start at any line in the Command Window.
Enter
in selection

None
Append selection to statement at command line and execute it.
Ctrl+Enter in hyperlink
None
Open hyperlink displayed in Command Window. For example, in the hyperlink of an error message, opens the file in the Editor/Debugger at that line number.


Previous page  Tab Completion Navigating Above the Command Line Next page

© 1994-2005 The MathWorks, Inc.