Find a Tab in Hundreds of Tabs of Dozens of Safari Windows

2020 May 29

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.

all windows

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.

search tab in menubar

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).

search tab in window

Then type some keywords of the tab to narrow down the matched result.

search tab in window
mac

Bash中的Meta键

2017 Apr 11

在Bash中输入命令时,可以使用一些快捷键。 比如输入Ctrl+a可以使光标回到行首。 Bash是用Readline库来处理输入的,实际上这些快捷键是Readline的快捷键。 在man bash的“Readline Key Bindings”章节可以看到详细的快捷键。

除了用Ctrl组合的快捷键,还有用Meta组合的快捷键。 比如Meta+f,可以使光标前进一个word。

实际上,现代的键盘并没有“Meta键”。只有一些古老的键盘上有“Meta键”。

meta key

(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.

mac

拷贝Vim中的文本到Mac OS X的系统粘贴板

2017 Feb 26

:[range]w[rite] !pbcopy

比如:.w !pbcopy把当前行写到系统粘贴板里,也就是复制当前行。 也可以选择文本后,再:w !pbcopy

:r !pbpaste,粘贴。

另外,如果vim在编译时打开了+clipboard,那么set clipboard=unnamed之后,yy之类的命令就可以直接复制到粘贴板了。

参考

mac