IPython does not read ~ / .inputrc

I am using iPython. The docs say that I should be able to reassign readline library keys with inputrc. Here is what I have in my inputrc:

set editing-mode emacs
set keymap emacs
Meta-h: backward-word
Meta-s: forward-word
Control-h: backward-char
Control-s: forward-char
Control-n: previous-history
Control-t: next-history
Control-p: yank
Meta-p: yank-pop

These mappings just don't work when I download iPython. I'm on OS X 10.9 Mavericks. I do not see any warnings that libedit is used instead of readline. Any ideas?

+4
source share
2 answers

From the IPython Documentation :

readline GNU, . readline , ; , . IPython ( ) , readline . , readline, ( , ):

readline_parse_and_bind: , readline.parse_and_bind(). , readline GNU, , readline .

readline_remove_delims: , - , readline, , . , , .

, readline_parse_and_bind ( /path/to/ipython/dir/profile_default/ipython_config. , ipython profile create.

+2

, , IPython vi-keys .

vi:

:

ipython profile create [profile-name]

, python (.py).

: :

5.0, IPython prompt_toolkit readline, , :: , "" "", , .

readline, ~/.inputrc( , INPUTRC ).

, vi, TerminalInteractiveShell.editing_mode IPython. ( )

, ipython_config.py , :

c = get_config()
c.TerminalInteractiveShell.editing_mode = 'vi'

IPython :

:

( ).

$> ipython --profile={profile-name}

+1

Source: https://habr.com/ru/post/1527056/


All Articles