我怎样才能解除和重新映射猛砸C-W' [英] How can I unbind and remap C-w in Bash?
问题描述
我要地图<大骨节病> CTRL 骨节病> - <大骨节病>是W 骨节病>到中的Bash 4.2杀死区域
。这个密钥被绑定到 UNIX的字指研
默认(删除字向后)。按照说明书,重新映射应尽可能与有选择的绑定
命令
I would like to map ctrl-w to kill-region
in Bash 4.2. This key is bound to unix-word-rubout
(delete word backward) by default. According to the manual, remapping should be possible with the bind
command which has the options
-u功能
解除绑定到命名函数的所有密钥。
-u function Unbind all keys bound to the named function.
-r keyseq
删除任何电流keyseq结合。
-r keyseq Remove any current binding for keyseq.
我试过绑定-r\\ CW
和绑定-u UNIX的字指研
但关键是不是取消设置,并为绑定-P | grep的UNIX的字指研
显示,有一个在映射没有变化。
I tried bind -r "\C-w"
and bind -u unix-word-rubout
but the key is not unset and, as bind -P | grep unix-word-rubout
reveals, there was no change in the mapping.
我打了绑定
一点,我能够解除其他内置密钥而不是<大骨节病> CTRL 骨节病> - <大骨节病>是W < /骨节病>。
I played with bind
a little and I'm able to unbind other built-in keys but not ctrl-w.
推荐答案
<大骨节病>控制骨节病> - <大骨节病>是W 骨节病>在的stty
到 WERASE
。您需要先解除绑定有它。
Ctrl-w is bound in stty
to werase
. You will need to unbind it there first.
stty werase undef
bind '"\C-w":kill-region'
这篇关于我怎样才能解除和重新映射猛砸C-W'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!