Org-mode 自带类似 Workflwoy 的 focus 功能

以前把玩 Workflowy 的时候,有一个功能我很喜欢,但它没具体名字,在 Workflowy 的首页上,是这么介绍的:

Zoom into your notes and focus on just one part 放大你的笔记,专注于某一部分

Clicking a bullet, zooms you into it and displays any indented items. This is how we view items as documents, by zooming into them. 点击一个项目符号,系统会将你放大到该项目符号,并显示任何缩进的内容。这就是我们如何将条目视为文档,通过放大查看它们。

If a bullet has no indented items, you’ll see an empty page with the title of the bullet you clicked on. 如果一个项目符号没有缩进的内容,你将看到一个空白页面,页面上显示你点击的项目符号的标题。

没想到 org-mode 里直接内置类似的功能了,具体命令是 =org-narrow-to-subtree=。执行这个命令之后,再执行 =widen=,视图就可以恢复原装。

只需要将快捷键绑定到具体的命令上就可用:

(global-set-key (kbd "C-c n") 'org-narrow-to-subtree)
(global-set-key (kbd "C-c w") 'widen)