我在用iPython。文档说我应该能够使用inputr重新映射readline库的键。以下是我的输入:
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
当我加载iPython时,这些映射根本不起作用。我在OSX10.9Mavericks上。我没有看到任何关于使用libedit而不是readline的警告。有什么想法吗?在
从IPython Documentation:
因此,您必须在配置文件中设置
readline_parse_and_bind
(默认情况下,这是在/path/to/ipython/dir/profile_default/ipython_config
中)。您可以使用ipython profile create
生成一个示例的默认配置。在我发现的方法是用 vi键选项已启用。在
将keybinding模式设置为vi:
生成空白配置文件:
运行该命令应显示生成的配置文件的路径, 它们是python(.py)文件。在
因此,导航到
^{pr2}$ipython_config.py
文件,并确保 其中包括以下几行:使用特定的配置文件启动IPython:
Source: Manging Profiles
在终端上,键入以下命令(不要键入大括号 实际上,它们只是 配置文件)。在
$> ipython profile={profile-name}
相关问题 更多 >
编程相关推荐