巴什 - 绑定密钥到字符串(不是函数) [英] Bash - bind key to a string (not a function)

查看:97
本文介绍了巴什 - 绑定密钥到字符串(不是函数)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何获得一个键绑定导致在命令行中插入任意文本?在zsh中我这样做:

How do I get a key binding to result in inserting arbitrary text at the command line? In zsh I do this:

bindkey -s "^[m" 'myspecialscript '

在bash中,是有一个相当于?的内置功能都将做我想做的。

In bash, is there an equivalent? None of the built-in functions will do what I want.

推荐答案

绑定'\\ E [E:/home/yourscript.sh\
\"'绑定到F5与您的主要$ p $粉煤替代的第一部分。

bind '"\e[[E": "/home/yourscript.sh\n"' binds to f5 replace the first part with your key pref

这篇关于巴什 - 绑定密钥到字符串(不是函数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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