prompt-toolkit

How to reuse completions from PathCompleter in prompt_toolkit

流过昼夜 提交于 2021-01-27 21:11:31
问题 I am creating a REPL tool for my project that (simplified for clarity) either directly executes entered commands or (if a command ".x some/path/to/file" is entered) reads and executes them from file. My question is related to auto-completing the user input (using prompt_toolkit). I have something like (minimum executable example): import prompt_toolkit from prompt_toolkit.completion import Completer, Completion from prompt_toolkit.document import Document from prompt_toolkit.contrib

How does one set specific vim-bindings in Ipython 5.0.0

对着背影说爱祢 提交于 2019-12-01 05:17:47
I understand that because Ipython 5.0.0 uses a new input library (prompt_toolkit) it no longer defaults to the editor mode specified in .inputrc (*nix). This option has to be set in an Ipython profile configuration file (see https://stackoverflow.com/a/38329940/2915339 ). My question is: having set vi-mode in the profile configuration file, how does one specify a particular keybinding? I like to use 'jk' for escape, for instance. jellycola You're right. prompt_toolkit ignores .inputrc . There does not seem to be a way to define custom keybindings for the vi mode in the IPython 5.0.0 profile

How does one set specific vim-bindings in Ipython 5.0.0

故事扮演 提交于 2019-12-01 03:13:33
问题 I understand that because Ipython 5.0.0 uses a new input library (prompt_toolkit) it no longer defaults to the editor mode specified in .inputrc (*nix). This option has to be set in an Ipython profile configuration file (see https://stackoverflow.com/a/38329940/2915339). My question is: having set vi-mode in the profile configuration file, how does one specify a particular keybinding? I like to use 'jk' for escape, for instance. 回答1: You're right. prompt_toolkit ignores .inputrc . There does