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).

Module: terminal.shortcuts.auto_suggest

2 Classes

class IPython.terminal.shortcuts.auto_suggest.AppendAutoSuggestionInAnyLine(style: str = 'class:auto-suggestion')

Bases: Processor

Append the auto suggestion to lines other than the last (appending to the last line is natively supported by the prompt toolkit).

__init__(style: str = 'class:auto-suggestion') None
apply_transformation(ti: TransformationInput) Transformation

Apply transformation. Returns a Transformation instance.


transformation_inputTransformationInput object.

class IPython.terminal.shortcuts.auto_suggest.NavigableAutoSuggestFromHistory

Bases: AutoSuggestFromHistory

A subclass of AutoSuggestFromHistory that allow navigation to next/previous suggestion from history. To do so it remembers the current position, but it state need to carefully be cleared on the right events.

get_suggestion(buffer: Buffer, document: Document) Optional[Suggestion]

Return None or a Suggestion instance.

We receive both Buffer and Document. The reason is that auto suggestions are retrieved asynchronously. (Like completions.) The buffer text could be changed in the meantime, but document contains the buffer document like it was at the start of the auto suggestion call. So, from here, don’t access buffer.text, but use document.text instead.


14 Functions

IPython.terminal.shortcuts.auto_suggest.accept_or_jump_to_end(event: KeyPressEvent)

Apply autosuggestion or jump to end of line.

IPython.terminal.shortcuts.auto_suggest.accept(event: KeyPressEvent)

Accept autosuggestion

IPython.terminal.shortcuts.auto_suggest.discard(event: KeyPressEvent)

Discard autosuggestion

IPython.terminal.shortcuts.auto_suggest.accept_word(event: KeyPressEvent)

Fill partial autosuggestion by word

IPython.terminal.shortcuts.auto_suggest.accept_character(event: KeyPressEvent)

Fill partial autosuggestion by character

IPython.terminal.shortcuts.auto_suggest.accept_and_keep_cursor(event: KeyPressEvent)

Accept autosuggestion and keep cursor in place

IPython.terminal.shortcuts.auto_suggest.accept_and_move_cursor_left(event: KeyPressEvent)

Accept autosuggestion and move cursor left in place

IPython.terminal.shortcuts.auto_suggest.backspace_and_resume_hint(event: KeyPressEvent)

Resume autosuggestions after deleting last character

IPython.terminal.shortcuts.auto_suggest.resume_hinting(event: KeyPressEvent)

Resume autosuggestions

IPython.terminal.shortcuts.auto_suggest.up_and_update_hint(event: KeyPressEvent)

Go up and update hint

IPython.terminal.shortcuts.auto_suggest.down_and_update_hint(event: KeyPressEvent)

Go down and update hint

IPython.terminal.shortcuts.auto_suggest.accept_token(event: KeyPressEvent)

Fill partial autosuggestion by token

IPython.terminal.shortcuts.auto_suggest.swap_autosuggestion_up(event: KeyPressEvent)

Get next autosuggestion from history.

IPython.terminal.shortcuts.auto_suggest.swap_autosuggestion_down(event: KeyPressEvent)

Get previous autosuggestion from history.