##// END OF EJS Templates
autoreformat with darker
autoreformat with darker

File last commit:

r26103:045fe6de
r26104:09b6e470
Show More
auto_suggest.rst
81 lines | 3.3 KiB | text/x-rst | RstLexer

Autosuggestion is a very useful feature available in fish, zsh, and prompt-toolkit.

Ptpython allows users to enable this feature in ptpython/config.py.

This feature allows users to accept autosuggestions with ctrl e, ctrl f, or right arrow as described below.

  1. Start ipython

image

  1. Run print("hello")

image1

  1. Press p to see the autosuggestion

image2

  1. Press ctrl f, or ctrl e, or right arrow to accept the suggestion

image3

You can also complete word by word:

  1. Run def say_hello(): print("hello")

image4

  1. Press d to see the autosuggestion

image5

  1. Press alt f to accept to accept the first word of the suggestion

image6

Importantly, this feature does not interfere with tab completion:

  1. After running def say_hello(): print("hello"), press d

image7

  1. Press Tab to start tab completion

image8

3A. Press Tab again to select the first option

image9

3B. Press alt f to accept to accept the first word of the suggestion

image10

3C. Press ctrl f or ctrl e to accept the entire suggestion

image11

To install a version of ipython with autosuggestions enabled, run:

pip install git+https://github.com/mskar/ipython@auto_suggest

Currently, autosuggestions are only shown in the emacs or vi insert editing modes: