23 September 2017

eamcs 阅读 org 文档的时候有个强大的功能 org-tree-to-indirect-buffer

将 org 文档切成两个 buffer,在另一个 buffer 里面对应的 Title 上,执行 org-tree-to-indirect-buffer 这个功能,另外一个 buffer 就会显示对应 Title 的内容

通过如下的配置,就可以在左边的 buffer 开启 readonly 模式的情况下,按住 enter ,然后右边就会显示对应的内容了

(add-hook 'view-mode-hook
          (lambda ()
            (define-key view-mode-map "n" 'next-line)
            (define-key view-mode-map "p" 'previous-line)
            (define-key view-mode-map "j" 'next-line)
            (define-key view-mode-map "k" 'previous-line)
            (define-key view-mode-map "h" 'backward-char)
            (define-key view-mode-map "l" 'forward-char)
            (define-key view-mode-map "\n" nil)
            (define-key view-mode-map "\r" nil)
            )
          )

(setq org-startup-folded  t)            ; 设置默认折叠

(add-hook 'org-mode-hook
          '(lambda ()
             (define-key org-mode-map (kbd "RET") 'org-tree-to-indirect-buffer)
             ))