mac iterm ctrl+a

发布时间:2018-08-30 11:57:10 阅读:911次

https://superuser.com/unanswered


In bash windows using the Terminal.app on OS X Lion, I can no longer use ctrl + A as a shortcut for going to the start of the command line. Other ctrl characters like ctrl + E don't work any longer either.

Any ideas?

^A and ^E are commands of bashs "emacs mode". Check your bash settings with

set -o

and verify that emacs is set to on. If your bash is in vi-mode (vi on) then you need to use the vi shortcuts to navigate within the row (ESC to leave insert mode, 0 to go to the beginning and $ to go to the end).

https://blog.csdn.net/miluowan/article/details/53914658


在Linux里反复敲入命令浪费时间,一直上下翻找也效果不佳。

bash默认的是模拟 emacs。使用set -o vi 让bash 模拟 vi 的操作。
vi 你会用吗? vi 和 emacs 是 UNIX/Linux 下最广泛使用的两个编辑器。除了能打打字以外,还能做很多工作。在你 set 好了之后,按几下 esc 键,就可以用以下快捷方式:
1. j 或者 k 就可以上下翻阅命令历史,而不必用上下键; 
2. 输入 / 可搜索历史命令;
3. 输入^定位行首,$定位到行尾;
4. 按 i 键进入 插入模式(insert mode) 之后,才可以继续打字之类的。


如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:mac iterm ctrl+a 出自老鄢博客 | 欢迎分享