Module: terminal.shortcuts — IPython 5.1.0 documentation

# Module: `terminal.shortcuts`

## 12 Functions

`IPython.terminal.shortcuts.` `cursor_in_leading_ws`()

  Turn any callable (which takes a cli and returns a boolean) into a Filter.

  This can be used as a decorator:

      @Condition
      def feature_is_active(cli):  # `feature_is_active` becomes a Filter.
          return True

  Parameters: | func – Callable which takes either a `CommandLineInterface` or nothing and returns a boolean. (Depending on what it takes, this will become a `Filter` or `CLIFilter`.)

`IPython.terminal.shortcuts.` `register_ipython_shortcuts`(registry, shell)

  Set up the prompt_toolkit keyboard shortcuts for IPython

`IPython.terminal.shortcuts.` `newline_or_execute_outer`(shell)

`IPython.terminal.shortcuts.` `previous_history_or_previous_completion`(event)

  Control-P in vi edit mode on readline is history next, unlike default prompt toolkit.

  If completer is open this still select previous completion.

`IPython.terminal.shortcuts.` `next_history_or_next_completion`(event)

  Control-N in vi edit mode on readline is history previous, unlike default prompt toolkit.

  If completer is open this still select next completion.

`IPython.terminal.shortcuts.` `dismiss_completion`(event)

`IPython.terminal.shortcuts.` `reset_buffer`(event)

`IPython.terminal.shortcuts.` `reset_search_buffer`(event)

`IPython.terminal.shortcuts.` `suspend_to_bg`(event)

`IPython.terminal.shortcuts.` `force_exit`(event)

  Force exit (with a non-zero return value)

`IPython.terminal.shortcuts.` `indent_buffer`(event)

`IPython.terminal.shortcuts.` `newline_with_copy_margin`(event)

  Preserve margin and cursor position when using Control-O to insert a newline in EMACS mode