我尝试将其添加到我的 ipython 配置中
c.TerminalInteractiveShell.shortcuts = [
{
"command": "IPython:auto_suggest.accept",
"new_keys": ["c-z"],
}
]
但是 ipython 抱怨说:
ValueError: Multiple shortcuts matching {'command': 'IPython:auto_suggest.accept'} found, please add keys/filter to select one of: [Binding(command=<function accept at 0x7f6fc3aa4ca0>, keys=['c-f'], condition='has_suggestion & default_buffer_focused & emacs_like_insert_mode'), Binding(command=<function accept at 0x7f6fc3aa4ca0>, keys=['right'], condition='has_suggestion & default_buffer_focused & emacs_like_insert_mode')]
该文档对于该主题并不十分详细,或者我还没有找到合适的地方来查看...
“对于已经有快捷方式的命令,您需要使用
match_keys
而不是 new_keys
”:
c.TerminalInteractiveShell.shortcuts = [
{
"command": "IPython:auto_suggest.accept",
"match_keys": ["c-z"],
}
]