击CTRL移动单词/字符串之间光标 [英] Bash CTRL to move cursor between words/strings

查看:86
本文介绍了击CTRL移动单词/字符串之间光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我(在一个时间去结束一个字,而不是一个字符)的使用,使用Ctrl键移动速度更快使用左,右箭头键的时候。

I am use to using the ctrl key to move faster when using the left and right arrow keys (goes to end of a word, instead of one char at a time).

我可以这样做在bash不知何故?

Can I do that in bash somehow?

我大概code,但我不知道是否有什么更容易/已经完成了。

I could probably code it, but I was wondering if there is something easier / already done.

推荐答案

在默认的ReadLine键绑定,Alt + B键可以追溯到一个字,按Alt + F前进一个词。

With the default readline key bindings, Alt+B goes back one word, Alt+F goes forward one word.

Ubuntu默认的设置还提供按Ctrl +箭头就像你已经习惯了。这些都是在的/ etc / INPUTRC 和规定如下:

The default Ubuntu setup additionally provides Ctrl+arrows like you're used to. These are in /etc/inputrc and specified as follows:

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

不知道为什么,我们需要他们三个人...

Not sure why we need three of them...

这篇关于击CTRL移动单词/字符串之间光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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