in ipython how do I accept and use an autocomplete suggestion?
Question:
I’m using Python 3.8.9 with IPython 8.0.1 on macOS. When I type anything whatsoever, it displays a predicted suggestion based on past commands. Cool.
However, how do I actually accept that suggestion? I tried the obvious: tab, which does not accept the suggestion, but rather opens up a menu with different suggestions, while the original suggestion is still there (see screenshot).
I also tried space, and return, but both of those act as if the suggestion was never made. How the heck do I actually use the ipython autosuggestion? Or is tab supposed to work and something is wrong with my ipython build or something?
Answers:
pressing the right arrow key on my keyboard was the only thing that worked. Kind of non-obvious.
CTRL-E
, CTRL-F
, or Right Arrow Key
https://ipython.readthedocs.io/en/6.x/config/shortcuts/index.html
Use any key that moves your cursor to the right e.g. END, Right Arrow, CTRL-F, or CTRL-E.
Note that CTRL-F and CTRL-E are simply Emacs’ keys for moving cursor to the right and to the end of the line respectively.
I’m using Python 3.8.9 with IPython 8.0.1 on macOS. When I type anything whatsoever, it displays a predicted suggestion based on past commands. Cool.
However, how do I actually accept that suggestion? I tried the obvious: tab, which does not accept the suggestion, but rather opens up a menu with different suggestions, while the original suggestion is still there (see screenshot).
I also tried space, and return, but both of those act as if the suggestion was never made. How the heck do I actually use the ipython autosuggestion? Or is tab supposed to work and something is wrong with my ipython build or something?
pressing the right arrow key on my keyboard was the only thing that worked. Kind of non-obvious.
CTRL-E
, CTRL-F
, or Right Arrow Key
https://ipython.readthedocs.io/en/6.x/config/shortcuts/index.html
Use any key that moves your cursor to the right e.g. END, Right Arrow, CTRL-F, or CTRL-E.
Note that CTRL-F and CTRL-E are simply Emacs’ keys for moving cursor to the right and to the end of the line respectively.