可击配置来搜索当前输入行字符串? [英] can Bash be configured to search string on the current input line?

查看:98
本文介绍了可击配置来搜索当前输入行字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关使用命令行的时候快速定位位置(是的,我是一个Emacs风扇)。观看击的人后,我找不到这样的提示。是否需要修改的readline的源$ C ​​$ C:支持呢?

For fast locating positions when using the command line(Yes, I'm an Emacs fan). After viewing Bash' man, I can't find such tips. Does it need to modify readline's source code to support this?

非常感谢你!

推荐答案

我不知道的方式,直接在命令行做,但bash所做的支持一键preSS将打开命令行在您选择的编辑器。从bash的手册页:

I don't know of a way to do it directly in the command line, but bash does support a keypress that will open the command line in your editor of choice. From the bash manpage:

   edit-and-execute-command (C-xC-e)
          Invoke  an  editor  on the current command line, and execute the
          result as shell commands.   Bash  attempts  to  invoke  $FCEDIT,
          $EDITOR, and emacs as the editor, in that order.

所以,打在Emacs绑定模式(默认),或在六绑定模式ESC V(设置-o VI 为)将打开CTRL-X CTRL-E的在由上述环境变量指定的编辑器的现有的命令行。您可以编辑命令行,一旦你保存并退出该命令将被执行编辑。

So hitting CTRL-x CTRL-e in emacs bindings mode (the default) or ESC v in vi bindings mode (set -o vi for that) will open the existing command line in the editor specified by the environment variables mentioned above. You can edit the command line, and once you save and quit the editor the command will be executed.

这篇关于可击配置来搜索当前输入行字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆