我想做这样的事
bind-key -T root ' <some-command>
bind-key -T root " <some-command>
bind-key -T root : <some-command>
bind-key -T root ; <some-command>
# or with alt
bind-key -T root M-' <some-command>
bind-key -T root M-" <some-command>
bind-key -T root M-: <some-command>
bind-key -T root M-; <some-command>
# or with control
bind-key -T root C-' <some-command>
bind-key -T root C-" <some-command>
bind-key -T root C-: <some-command>
bind-key -T root C-; <some-command>
# or with alt & control
bind-key -T root M-C-' <some-command>
bind-key -T root M-C-" <some-command>
bind-key -T root M-C-: <some-command>
bind-key -T root M-C-; <some-command>
其中哪些是可能的?
是否有一个工具可以获取按下的键并提供可用的 ascii 表示bind-key
。类似于命令模式下的 vim Control-v (:)。
答案1
您应该能够进行以下绑定:
bind-key -T root '"' send-keys ' dblquot'
bind-key -T root "'" send-keys ' quot'
bind-key -T root : send-keys ' colon'
bind-key -T root \; send-keys ' semicolon'
及其元前缀版本:
bind-key -T root 'M-"' send-keys ' Mdblquot'
bind-key -T root "M-'" send-keys ' Mquot'
bind-key -T root M-: send-keys ' Mcolon'
bind-key -T root M-\; send-keys ' Msemicolon'
并测试它们,但终端仿真器无法将控制应用于 ascii 范围之外的字符@
(_
即 a 到 z 加 @[\]^_
),因此您无法输入Control-'等等,也无法输入它们的 Meta-Control 版本。