简体   繁体   English

Ctrl-P 在 mac 终端上的命令行编辑 vi 模式下不起作用

[英]Ctrl-P doesn't work on vi mode of command line editing on mac terminal

https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html said we could do set -o vi to use vi mode instead of emacs mode for command line editing. https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html说我们可以set -o vi使用 vi 模式而不是 emacs 模式进行命令行编辑。

And the help: ex-edit-index saishelp: ex-edit-index sais

c_CTRL-P        CTRL-P          after using 'wildchar' with multiple matches:
                                go to previous match, otherwise: recall older
                                command-line from history.

However when I press CTRL-P I just got ^P但是,当我按CTRL-P我得到了^P

在此处输入图片说明

May I know why ?我可以知道为什么吗?

Readline's "vi mode" is neither vi nor Vim. Readline 的“vi 模式”既不是 vi 也不是 Vim。 It is a partial emulation of vi shoehorned into the command line context.它是硬塞到命令行上下文中的 vi 的部分模拟。

That <Cp> you are referring to is a Vim command so there is no reason whatsoever to expect it to do anything in that context.您所指的<Cp>是一个Vim命令,因此没有任何理由期望它在该上下文中执行任何操作。 Vim's documentation is totally irrelevant in this case.在这种情况下,Vim 的文档完全无关紧要。

Search for Vim Mode bindings in $ man readline for the actual bindings at your disposal in that "mode".$ man readline搜索Vim Mode bindings$ man readline获取该“模式”中可供您使用的实际绑定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM