Important
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
IPython shortcuts¶
Shortcuts available in an IPython terminal.
Note
This list is automatically generated. Key bindings defined in prompt_toolkit
may differ
between installations depending on the prompt_toolkit
version.
Comma-separated keys, e.g. Esc, f, indicate a sequence which can be activated by pressing the listed keys in succession.
Plus-separated keys, e.g. Esc + f indicate a combination which requires pressing all keys simultaneously.
Hover over the ⓘ icon in the filter column to see when the shortcut is active.
You can use TerminalInteractiveShell.shortcuts
configuration
to modify, disable or add shortcuts.
Shortcut |
Description and identifier |
Filter |
---|---|---|
{ |
Auto-close braces. |
ⓘ |
[ |
Auto-close brackets. |
ⓘ |
ctrl + h (or backspace) |
Delete auto-closed parenthesis. |
ⓘ |
ctrl + h (or backspace) |
Delete auto-closed parenthesis. |
ⓘ |
ctrl + h (or backspace) |
Delete auto-closed parenthesis. |
ⓘ |
ctrl + h (or backspace) |
Delete auto-closed parenthesis. |
ⓘ |
ctrl + h (or backspace) |
Delete auto-closed parenthesis. |
ⓘ |
" |
Auto-close docstring (double quotes). |
ⓘ |
' |
Auto-close docstring (single quotes). |
ⓘ |
" |
Auto-close double quotes. |
ⓘ |
( |
Auto-close parenthesis. |
ⓘ |
{ |
Auto-close braces in raw strings. |
ⓘ |
[ |
Auto-close bracker in raw strings. |
ⓘ |
( |
Auto-close parenthesis in raw strings. |
ⓘ |
' |
Auto-close single quotes. |
ⓘ |
} |
Skip over automatically added parenthesis/quote. |
ⓘ |
] |
Skip over automatically added parenthesis/quote. |
ⓘ |
) |
Skip over automatically added parenthesis/quote. |
ⓘ |
" |
Skip over automatically added parenthesis/quote. |
ⓘ |
' |
Skip over automatically added parenthesis/quote. |
ⓘ |
ctrl + f |
Accept autosuggestion. |
ⓘ |
right |
Accept autosuggestion. |
ⓘ |
escape, down |
Accept autosuggestion and keep cursor in place. |
ⓘ |
ctrl + left |
Accept autosuggestion and move cursor left in place. |
ⓘ |
escape, right |
Fill partial autosuggestion by character. |
ⓘ |
end |
Apply autosuggestion or jump to end of line. |
ⓘ |
ctrl + e |
Apply autosuggestion or jump to end of line. |
ⓘ |
ctrl + right |
Fill partial autosuggestion by token. |
ⓘ |
escape, f |
Fill partial autosuggestion by word. |
ⓘ |
ctrl + h (or backspace) |
Resume autosuggestions after deleting last character. |
ⓘ |
escape |
Discard autosuggestion. |
ⓘ |
delete |
Discard autosuggestion. |
ⓘ |
ctrl + down |
Go down and update hint. |
ⓘ |
right |
Resume autosuggestions. |
ⓘ |
ctrl + down |
Get previous autosuggestion from history. |
ⓘ |
ctrl + up |
Get next autosuggestion from history. |
ⓘ |
ctrl + up |
Go up and update hint. |
ⓘ |
ctrl + g |
Dismiss completion. |
ⓘ |
ctrl + m (or enter) |
. |
ⓘ |
ctrl + i (or tab) |
Indent buffer. |
ⓘ |
ctrl + o |
Insert a newline after the cursor indented appropriately. |
ⓘ |
ctrl + n |
Control-N in vi edit mode on readline is history previous, unlike default prompt toolkit. |
ⓘ |
f2 |
Open code from input in external editor. |
ⓘ |
ctrl + p |
Control-P in vi edit mode on readline is history next, unlike default prompt toolkit. |
ⓘ |
ctrl + \ |
Quit application with |
- |
escape, ctrl + m (or enter) |
Reformat code and execute it. |
ⓘ |
ctrl + c |
Reset buffer. |
ⓘ |
ctrl + c |
Reset search buffer. |
ⓘ |
ctrl + z |
Suspend to background. |
ⓘ |
ctrl + v |
Stub used on other platforms. |
ⓘ |
right |
Accept suggestion. |
ⓘ |
ctrl + e |
Accept suggestion. |
ⓘ |
ctrl + f |
Accept suggestion. |
ⓘ |
escape, f |
Fill partial suggestion. |
ⓘ |
ctrl + i (or tab) |
Key binding handler for readline-style tab completion. |
ⓘ |
ctrl + b |
Move back a character. |
ⓘ |
ctrl + w |
Kills the word before point, using “not a letter nor a digit” as a word boundary. |
ⓘ |
escape, h |
Kills the word before point, using “not a letter nor a digit” as a word boundary. |
ⓘ |
escape, b |
Move back to the start of the current or previous word. |
ⓘ |
ctrl + a |
Move to the start of the current line. |
ⓘ |
escape, c |
Capitalize the current (or following) word. |
ⓘ |
escape, l |
Lowercase the current (or following) word. |
ⓘ |
ctrl + x, ctrl + e |
Invoke an editor on the current command line, and accept the result. |
ⓘ |
v |
Invoke an editor on the current command line, and accept the result. |
ⓘ |
ctrl + x, ctrl + e |
Invoke an editor on the current command line, and accept the result. |
ⓘ |
ctrl + x, e |
Invoke an editor on the current command line, and accept the result. |
ⓘ |
ctrl + k |
Kill the text from the cursor to the end of the line. |
ⓘ |
escape, d |
Kill from point to the end of the current word, or if between words, to the end of the next word. |
ⓘ |
ctrl + _ |
Incremental undo. |
ⓘ |
escape, u |
Uppercase the current (or following) word. |
ⓘ |
ctrl + y |
Paste before cursor. |
ⓘ |
escape, . |
Like |
ⓘ |
escape, y |
Rotate the kill ring, and yank the new top. |
ⓘ |
ctrl + m (or enter) |
Accept input when enter has been pressed. |
ⓘ |
ctrl + i (or tab) |
Display completions (like Readline). |
ⓘ |
ctrl + d |
Exit when Control-D has been pressed. |
ⓘ |
<sigint> |
Abort when Control-C has been pressed. |
- |
ctrl + c |
Abort when Control-C has been pressed. |
ⓘ |
ctrl + z |
Suspend process to background. |
ⓘ |