IPython shortcuts — IPython 5.1.0 documentation

# IPython shortcuts

Available shortcut in IPython terminal.

Warning

This list is automatically generated, and may not hold all the available shortcut. In particular, it may depends on the version of `prompt_toolkit` installed during the generation of this page.

## Single Filtered shortcuts

Shortcut | Filter | Description
--- | --- | ---
`<PageDown>` | (Not: HasSelection) | Move `forward’ through the history list, fetching the next command
`<PageUp>` | (Not: HasSelection) | Move `back’ through the history list, fetching the previous command
`<Bracketed-Paste>` | Always | Pasting from clipboard
`<C-C>` | Always | Abort when Control-C has been pressed
`<C-Down>` | Always | Move `forward’ through the history list, fetching the next command
`<C-L>` | Always | Clear the screen and redraw everything at the top of the screen
`<C-Up>` | Always | Move `back’ through the history list, fetching the previous command
`<C-Z>` | Always | By default, control-Z should literally insert Ctrl-Z
`<Cursor-Position-Response>` | Always | Handle incoming Cursor-Position-Request response
`<End>` | Always | Move to the end of the line
`<Home>` | Always | Move to the start of the current line
`<Left>` | Always | Move back a character
`<Right>` | Always | Move forward a character
`<Vt100-Mouse-Event>` | Always | Handling of incoming mouse event
`<Windows-Mouse-Event>` | Always | Handling of mouse events for Windows
`<C-D>` | Condition | Exit
`<C-E>` | Condition | Accept suggestion
`<C-F>` | Condition | Accept suggestion
`<C-J>` | Condition | Newline (in case of multiline input
`<Right>` | Condition | Accept suggestion
`<C-A>` | EmacsMode | Move to the start of the current line
`<C-B>` | EmacsMode | Move back a character
`<C-E>` | EmacsMode | Move to the end of the line
`<C-F>` | EmacsMode | Move forward a character
`<C-Left>` | EmacsMode | Move back to the start of the current or previous word
`<C-Right>` | EmacsMode | Move forward to the end of the next word
`<C-Space>` | EmacsMode | Start of the selection (if the current buffer is not empty)
`<C-SquareClose> <Any>` | EmacsMode | When Ctl-] + a character is pressed
`<C-X> <C-X>` | EmacsMode | Move cursor back and forth between the start and end of the current line
`<Escape>` | EmacsMode | By default, ignore escape key
`<Escape> <C-SquareClose> <Any>` | EmacsMode | Like Ctl-], but backwards
`<Escape> <Left>` | EmacsMode | Cursor to start of previous word
`<Escape> <Right>` | EmacsMode | Cursor to start of next word
`<Escape> a` | EmacsMode | Previous sentence
`<Escape> b` | EmacsMode | Move back to the start of the current or previous word
`<Escape> e` | EmacsMode | Move to end of sentence
`<Escape> f` | EmacsMode | Move forward to the end of the next word
`<Escape>` | ViMode | Escape goes to vi navigation mode

## Multi Filtered shortcuts

Shortcut | Filter | Description
--- | --- | ---
`<C-J>` | (And: (Not: Condition), Condition) | Enter, accept input
`<Escape> -` | (And: (Not: HasArg), EmacsMode) |
`<C-R>` | (And: (Not: HasFocus), ViMode) | Vi-style backward search
`<C-S>` | (And: (Not: HasFocus), ViMode) | Vi-style forward search
`<C-G>` | (And: (Not: HasSelection), EmacsMode) | Control + G: Cancel completion menu and validation state
`<C-N>` | (And: (Not: HasSelection), EmacsMode) | Next line
`<C-P>` | (And: (Not: HasSelection), EmacsMode) | Previous line
`<C-Q> <Any>` | (And: (Not: HasSelection), EmacsMode) | Quoted insert
`<Escape> <` | (And: (Not: HasSelection), EmacsMode) | Move to the first line in the history
`<Escape> >` | (And: (Not: HasSelection), EmacsMode) | Move to the end of the input history, i
`<C-K>` | (And: (Or: ViInsertMode, ViReplaceMode), ViMode) | Go into digraph mode
`z +` | (And: (Or: ViNavigationMode, ViSelectionMode), ViMode) | Scrolls the window to makes the current line the first line in the visible region
`z -` | (And: (Or: ViNavigationMode, ViSelectionMode), ViMode) | Scrolls the window to makes the current line the last line in the visible region
`z <C-J>` | (And: (Or: ViNavigationMode, ViSelectionMode), ViMode) | Scrolls the window to makes the current line the first line in the visible region
`z b` | (And: (Or: ViNavigationMode, ViSelectionMode), ViMode) | Scrolls the window to makes the current line the last line in the visible region
`z t` | (And: (Or: ViNavigationMode, ViSelectionMode), ViMode) | Scrolls the window to makes the current line the first line in the visible region
`z z` | (And: (Or: ViNavigationMode, ViSelectionMode), ViMode) | Center Window vertically around cursor
`0` | (And: (Or: ViNavigationMode, ViSelectionMode, ViWaitingForTextObjectMode), HasArg, ViMode) | Zero when an argument was already give
`<C-D>` | (And: Condition, (Or: ViInsertMode, EmacsInsertMode)) | Delete character before the cursor
`-` | (And: Condition, EmacsMode) | When ‘-‘ is typed again, after exactly ‘-‘ has been given as an argument, ignore this
`<Escape> <C-J>` | (And: EmacsInsertMode, Condition, EmacsMode) | Accept the line regardless of where the cursor is
`<C-Delete>` | (And: EmacsInsertMode, EmacsMode) | Kill from point to the end of the current word, or if between words, to the end of the next word
`<C-O>` | (And: EmacsInsertMode, EmacsMode) | Insert newline, but don’t move the cursor
`<C-Underscore>` | (And: EmacsInsertMode, EmacsMode) | Incremental undo
`<C-X> <C-U>` | (And: EmacsInsertMode, EmacsMode) | Incremental undo
`<C-X> r y` | (And: EmacsInsertMode, EmacsMode) | Paste before cursor
`<C-Y>` | (And: EmacsInsertMode, EmacsMode) | Paste before cursor
`<Escape> *` | (And: EmacsInsertMode, EmacsMode) | `meta-*`: Insert all possible completions of the preceding text
`<Escape> .` | (And: EmacsInsertMode, EmacsMode) | Rotate through the last word (white-space delimited) of the previous lines in history
`<Escape> /` | (And: EmacsInsertMode, EmacsMode) | M-/: Complete
`<Escape> <Backspace>` | (And: EmacsInsertMode, EmacsMode) | Kill the word behind point
`<Escape> <C-H>` | (And: EmacsInsertMode, EmacsMode) | Kill the word behind point
`<Escape> \` | (And: EmacsInsertMode, EmacsMode) | Delete all spaces and tabs around point
`<Escape> c` | (And: EmacsInsertMode, EmacsMode) | Capitalize the current (or following) word
`<Escape> d` | (And: EmacsInsertMode, EmacsMode) | Kill from point to the end of the current word, or if between words, to the end of the next word
`<Escape> l` | (And: EmacsInsertMode, EmacsMode) | Lowercase the current (or following) word
`<Escape> t` | (And: EmacsInsertMode, EmacsMode) | Swap the last two words before the cursor
`<Escape> u` | (And: EmacsInsertMode, EmacsMode) | Uppercase the current (or following) word
`G` | (And: HasArg, ViMode) | If an argument is given, move to this line in the history
`<C-C>` | (And: HasFocus, EmacsMode) | Abort an incremental search and restore the original line
`<C-G>` | (And: HasFocus, EmacsMode) | Abort an incremental search and restore the original line
`<C-J>` | (And: HasFocus, EmacsMode) | When enter pressed in isearch, quit isearch mode
`<C-J>` | (And: HasFocus, ViMode) | Apply the search
`<C-C> <` | (And: HasSelection, EmacsMode) | Unindent selected text
`<C-C> >` | (And: HasSelection, EmacsMode) | Indent selected text
`<C-G>` | (And: HasSelection, EmacsMode) | Cancel selection
`<C-N>` | (And: HasSelection, EmacsMode) | Next line (but don’t cycle through history
`<C-P>` | (And: HasSelection, EmacsMode) | Previous line
`<C-W>` | (And: HasSelection, EmacsMode) | Cut selected text
`<C-X> r k` | (And: HasSelection, EmacsMode) | Cut selected text
`<Escape> w` | (And: HasSelection, EmacsMode) | Copy selected text
`<Any>` | (And: ViDigraphMode, Condition, ViMode) | Insert digraph
`<C-E>` | (And: ViInsertMode, ViMode) | Cancel completion
`<C-P>` | (And: ViInsertMode, ViMode) | Control-P: To previous completion
`<C-V> <Any>` | (And: ViInsertMode, ViMode) | Insert a character literally (quoted insert)
`<C-X> <C-F>` | (And: ViInsertMode, ViMode) | Complete file names
`<C-X> <C-L>` | (And: ViInsertMode, ViMode) | Pressing the ControlX - ControlL sequence in Vi mode does line completion based on the other lines in the document and the history
`<C-Y>` | (And: ViInsertMode, ViMode) | Accept current completion
`C` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | # Change to end of line
`J` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Join lines
`O` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Open line above and enter insertion mode
`S` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Change current line
`c c` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Change current line
`g J` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Join lines without space
`g U U` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Uppercase current line
`g u u` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Lowercase current line
`g ~ ~` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Swap case of the current line
`o` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Open line below and enter insertion mode
`s` | (And: ViNavigationMode, (Not: IsReadOnly), ViMode) | Substitute with new text (Delete character(s) and go to insert mode
`" <Any> P` | (And: ViNavigationMode, ViMode) | Paste (before) from named register
`" <Any> p` | (And: ViNavigationMode, ViMode) | Paste from named register
`#` | (And: ViNavigationMode, ViMode) | Go to previous occurence of this word
`*` | (And: ViNavigationMode, ViMode) | Go to next occurence of this word
`+` | (And: ViNavigationMode, ViMode) | Move to first non whitespace of next line
`-` | (And: ViNavigationMode, ViMode) | Move to first non whitespace of previous line
`/` | (And: ViNavigationMode, ViMode) | Vi-style forward search
`< <` | (And: ViNavigationMode, ViMode) | Unindent lines
`<Backspace>` | (And: ViNavigationMode, ViMode) | In navigation-mode, move cursor
`<C-H>` | (And: ViNavigationMode, ViMode) | In navigation-mode, move cursor
`<C-J>` | (And: ViNavigationMode, ViMode) | In navigation mode, pressing enter will always return the input
`<C-N>` | (And: ViNavigationMode, ViMode) | Arrow down and Control-N in navigation mode
`<C-P>` | (And: ViNavigationMode, ViMode) | Arrow up and ControlP in navigation mode go up
`<C-V>` | (And: ViNavigationMode, ViMode) | Enter block selection mode
`<Down>` | (And: ViNavigationMode, ViMode) | Arrow down and Control-N in navigation mode
`<Insert>` | (And: ViNavigationMode, ViMode) | Presing the Insert key
`<Up>` | (And: ViNavigationMode, ViMode) | Arrow up and ControlP in navigation mode go up
`> >` | (And: ViNavigationMode, ViMode) | Indent lines
`?` | (And: ViNavigationMode, ViMode) | Vi-style backward search
`N` | (And: ViNavigationMode, ViMode) | Search previous
`P` | (And: ViNavigationMode, ViMode) | Paste before
`R` | (And: ViNavigationMode, ViMode) | Go to ‘replace’-mode
`V` | (And: ViNavigationMode, ViMode) | Start lines selection
`Y` | (And: ViNavigationMode, ViMode) | Yank the whole line
`d d` | (And: ViNavigationMode, ViMode) | Delete line
`j` | (And: ViNavigationMode, ViMode) | Go down, but if we enter a new history entry, go to the start of the line
`k` | (And: ViNavigationMode, ViMode) | Go up, but if we enter a new history entry, move to the start of the line
`n` | (And: ViNavigationMode, ViMode) | Search next
`p` | (And: ViNavigationMode, ViMode) | Paste after
`r <Any>` | (And: ViNavigationMode, ViMode) | Replace single character under cursor
`v` | (And: ViNavigationMode, ViMode) | Enter character selection mode
`x` | (And: ViNavigationMode, ViMode) | Delete character
`y y` | (And: ViNavigationMode, ViMode) | Yank the whole line
`~` | (And: ViNavigationMode, ViMode) | Reverse case of current character and move cursor forward
`<Any>` | (And: ViReplaceMode, ViMode) | Insert data at cursor position
`J` | (And: ViSelectionMode, (Not: IsReadOnly), ViMode) | Join selected lines
`g J` | (And: ViSelectionMode, (Not: IsReadOnly), ViMode) | Join selected lines without space
`<C-V>` | (And: ViSelectionMode, ViMode) | Exit block selection mode, or go from non block selection mode to block selection mode
`V` | (And: ViSelectionMode, ViMode) | Exit line selection mode, or go from non line selection mode to line selection mode
`a W` | (And: ViSelectionMode, ViMode) | Switch from visual linewise mode to visual characterwise mode
`a w` | (And: ViSelectionMode, ViMode) | Switch from visual linewise mode to visual characterwise mode
`j` | (And: ViSelectionMode, ViMode) | Arrow down in selection mode
`k` | (And: ViSelectionMode, ViMode) | Arrow up in selection mode
`v` | (And: ViSelectionMode, ViMode) | Exit character selection mode, or go from non-character-selection mode to character selection mode
`x` | (And: ViSelectionMode, ViMode) | Cut selection
`<Any>` | (Or: ViInsertMode, EmacsInsertMode) | Insert yourself
`<BackTab>` | (Or: ViInsertMode, EmacsInsertMode) | Shift+Tab: go to previous completion
`<Backspace>` | (Or: ViInsertMode, EmacsInsertMode) | Delete the character behind the cursor
`<C-H>` | (Or: ViInsertMode, EmacsInsertMode) | Delete the character behind the cursor
`<C-K>` | (Or: ViInsertMode, EmacsInsertMode) | Kill the text from the cursor to the end of the line
`<C-T>` | (Or: ViInsertMode, EmacsInsertMode) | Emulate Emacs transpose-char behavior: at the beginning of the buffer, do nothing
`<C-U>` | (Or: ViInsertMode, EmacsInsertMode) | Kill backward from the cursor to the beginning of the current line
`<C-W>` | (Or: ViInsertMode, EmacsInsertMode) | Kill the word behind point
`<Delete>` | (Or: ViInsertMode, EmacsInsertMode) | Delete character before the cursor
`<ShiftDelete>` | (Or: ViInsertMode, EmacsInsertMode) | Delete character before the cursor