发布于 2016-01-14 01:08:55 | 523 次阅读 | 评论: 0 | 来源: PHPERZ

这里有新鲜出炉的精品教程,程序狗速度看过来!

iTerm2 终端仿真程序

iTerm2 是终端仿真程序 iTerm 的替代品,支持 Mac OS 10.5 以及以上的版本。


重装 Mac 才想起来很多配置没有备份过, 找起来麻烦, 所以记一下

按文本开头搜索命令

一个是 Bash 里按上下键直接查找历史, 匹配开头相同的内容
最开始是我朋友在 Matlab 下用到提到想要这个方案, 一起找了结果真有
于是记录一下配置:

➤➤ cat ~/.inputrc
"\e[A":history-search-backward
"\e[B":history-search-forward

set show-all-if-ambiguous on
set completion-ignore-case on

删除行删除单词

Mac 下普通的 Option Delete 删除单词, Command Delete 删除行
Terminal 里一般不一样, 不过 iTerm2 里可以定制看文章

https://coderwall.com/p/ds2dha/word-line-deletion-and-navigation-shortcuts-in-iterm2

注意一下, iTerm2 是有两个地方设置快捷键, 注意会发生一些覆盖

按单词按行移动

也是常用的习惯, Option 加方向键移动单词, Command 加方向到行首行尾
这个也可以配置, 同样是 Send Hex Code 和 Send Escape Sequence 实现

https://coderwall.com/p/h6yfda/use-and-to-jump-forwards-backwards-words-in-iterm-2-on-os-x
http://stackoverflow.com/questions/6205157/iterm2-how-to-get-jump-to-beginning-end-of-line-in-bash-shell

在 title bar 显示当前目录

网上找到的办法不是 iTerm2 自带的, 而是 Bash 里生成的方案, 看文章:

http://apple.stackexchange.com/questions/90725/for-iterm2-how-do-i-make-the-working-directory-appear-in-the-window-title

插入上一条命令最后一个词

Linux 下 Alt dot(.) 能做到, 在 OS X 里是 ESC dot
可以通过下面的选项让右侧的 Option 键模拟 ESC 的行为
也可以使用其他快捷键配置发送这个 ESC dot, 比如我用了 Command dot

http://apple.stackexchange.com/questions/85067/alt-and-vertical-bar-pipe-on-terminal/85152#85152



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务