我怎样才能解除和重新映射猛砸C-W' [英] How can I unbind and remap C-w in Bash?

查看:140
本文介绍了我怎样才能解除和重新映射猛砸C-W'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要地图<大骨节病> 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屋!

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