GNU 屏幕自定义键绑定格式
我正在尝试将按键绑定添加到 .screenrc 文件中,以使很多事情变得更容易。到目前为止我已经理解了以下模式
bindkey "^k" eval "copy" "stuff k" # enter copy mode and move up one line
这里^对应于Ctrl键,eval是评估而“copy”表示进入复制模式。我假设,东西就像一个转义字符,可以帮助屏幕理解 k 是复制模式下的命令。现在我可以使用
进入复制模式,并使用任何未使用的键(例如 ] 或 Esc)转义它。
我想更好地理解按键绑定格式,并且需要一些像 VIM 中的 :h keycodes
这样的源代码,它显示了 VIM 理解的所有可能的按键绑定。
是否有命令或帮助页面可以告诉我按键绑定屏幕可以理解哪些内容?例如,我们如何知道 screen 如何理解 PageUp/PageDown,以便我们可以将其映射到某个函数?
I am trying to add key bindings to the .screenrc file for making a lot of things easier. So far I have understood the following pattern
bindkey "^k" eval "copy" "stuff k" # enter copy mode and move up one line
Here ^ corresponds to the Ctrl key, eval is evaluate while "copy" signifies entry into the copy mode. stuff, I am assuming, is like an escape character which helps screen understand that k is a command inside copy mode. Now I can enter the copy mode with <Ctrl-k>
and escape it using any unused key like ] or Esc.
I want to understand the key binding format a little better and need some source like :h keycodes
in VIM which shows all the possible key bindings that VIM understands.
Is there a command or help page that can tell me what key bindings screen can understand? For example, how do we know how screen understands PageUp/PageDown so that we can map it to some function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看联机帮助页的输入翻译部分。那里有一个表,其中包含键的所有 termcap 名称,您可以使用它,例如
bindkey -k k5 other
(这将 F5 键绑定到other
命令,以便在活动窗口)。另外,请查看
bind
命令,该命令绑定从命令模式输入的键(按Ctrl-a
后)。stuff
命令发送其参数,就像用户在提示符下键入它们一样。我过去曾使用它通过将击键“填充”到我的所有窗口中来控制多台机器上的多个 shell。Take a look at the Input Translation section of the manpage. There's a table there with all the termcap names for the keys, which you can use like
bindkey -k k5 other
(this binds the F5 key to theother
command for toggling between active windows).Also, look at the
bind
command, which binds keys which are entered from command mode (after pressingCtrl-a
).The
stuff
command sends its arguments as though the user typed them at the prompt. I have used this in the past to control multiple shells on multiple machines by "stuffing" keystrokes into all my windows.