Find a Tab in Hundreds of Tabs of Dozens of Safari Windows
When use Safari in my Mac, I often keep hundreds of tabs open in dozens of Safari windows.
For a recently working on tab, I may remember which Safari window it’s in, and switch to that window by looking at
the snapshots of all windows brought up by Ctrl + Down arrow
.
To locate a tab which I totally forget where is it in, it can be easily found via the menu bar -> Help -> Search. Type the keywords of that tab in the input box.
If you know which Safari window a tab is in, click the “double square” icon in the upper-right corner of the window (or View -> Show Tab Overview).
Then type some keywords of the tab to narrow down the matched result.
Bash中的Meta键
在Bash中输入命令时,可以使用一些快捷键。
比如输入Ctrl+a
可以使光标回到行首。
Bash是用Readline库来处理输入的,实际上这些快捷键是Readline的快捷键。
在man bash
的“Readline Key Bindings”章节可以看到详细的快捷键。
除了用Ctrl
组合的快捷键,还有用Meta
组合的快捷键。
比如Meta+f
,可以使光标前进一个word。
实际上,现代的键盘并没有“Meta键”。只有一些古老的键盘上有“Meta键”。
(By Retro-Computing Society of Rhode Island - Own work, CC BY-SA 3.0, Link)
现在一般用Alt
键来作为“Meta键”。
比如macOS自带的“终端”程序,就是这样(“终端”->“偏好设置”->“描述文件”->“键盘”->“将Option键做为Meta键”)。
对于iTerm2(Build 3.0.15),如果要用Alt
键作为“Meta键”则需要如下配置,
iTerm2->Preferences->Profiles->Keys->Left option key acts as +Esc
For most users, selecting “+Esc” here is the right choice. The “Meta” option sets the high bit of the input character, and is not compatible with modern systems.
拷贝Vim中的文本到Mac OS X的系统粘贴板
:[range]w[rite] !pbcopy
比如:.w !pbcopy
把当前行写到系统粘贴板里,也就是复制当前行。
也可以选择文本后,再:w !pbcopy
。
:r !pbpaste
,粘贴。
另外,如果vim在编译时打开了+clipboard
,那么set clipboard=unnamed
之后,yy
之类的命令就可以直接复制到粘贴板了。