显示特定标题级别的组织模式大纲

发布于 2024-11-11 18:24:19 字数 232 浏览 4 评论 0原文

我正在使用组织模式为我的论文制定大纲,并且我想显示达到特定级别的所有标题(例如所有 1 级和 2 级标题)。

我在组织模式手册中没有找到任何相关内容。循环显示要么仅显示 1 级标题,要么显示所有标题,目前我的大纲中的信息太多了。

谢谢,

丹尼尔。

更新:我找到了他的解决方法:设置变量 org-cycle-max-level。不过,这是一个全球环境。

I'm making an outline for my thesis using org-mode, and I'd like to show all headings up to a certain level (e.g. all level-1 and level-2 headings).

I haven't found anything about that in the org-mode manual. Cycling shows either only level-1 headings, or all headings, which is too much information in my outline right now.

Thanks,

daniel.

Update: I found a workaround for his: set the variable org-cycle-max-level. This is a global setting, though.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

極樂鬼 2024-11-18 18:24:19

刚刚偶然发现了这个问题。一年后,但到底是什么......有一些命令可以让您显示一定级别的标题。

一个命令是 C-抄送选项卡 将显示最高级别 (=1,2,3...) 的副标题。

另一个命令是C-S-tab 将对整个缓冲区进行操作。它显示 级别以下的所有标题 (=1,2,3...)

Just stumbled on this question. One year later but what the heck.. There are commands for this that allows you to show headings to a certain level.

One command is C-<n> C-c tab will show subheadings up to level <n> (<n>=1,2,3...).

Another command is C-<n> S-tab which will operate on the whole buffer. It shows all headings up to level <n> (<n>=1,2,3...)

童话里做英雄 2024-11-18 18:24:19

我找到了一个适合我的解决方案:命令 org-content 显示文件夹层次结构,并给它一个数字参数正是我想要的:限制显示的最大级别。在我的示例中,我想显示 2 个级别,因此我可以执行 C-2 Mx org-content

我还将自己的命令添加到我的 .emacs init 文件中,将该命令绑定到 Cc m

(defun org-show-two-levels ()
  (interactive)
  (org-content 2))

(add-hook 'org-mode-hook
  (lambda ()
    (define-key org-mode-map "\C-cm" 'org-show-two-levels)))

I found a solution that suits me: The command org-content shows the folder hierarchy, and giving it a numeric argument does exactly what I want: limit the maximum level shown. In my example, I wanted to show 2 levels, so I can do C-2 M-x org-content <RET>.

I also added my own command to my .emacs init file, binding that command to C-c m

(defun org-show-two-levels ()
  (interactive)
  (org-content 2))

(add-hook 'org-mode-hook
  (lambda ()
    (define-key org-mode-map "\C-cm" 'org-show-two-levels)))
素年丶 2024-11-18 18:24:19

我来晚了,但让我们为后代添加一个简单的方法。只需使用Cycle Global Visibility ()即可。如果您的标题打开,它将关闭它们。但是,如果您在折叠所有标题的情况下重复应用它,它们将打开到您想要的级别。

我通过 + 从键盘上使用它。您还可以在 Org 菜单(在 Emacs 中)的显示/隐藏 -> 下找到它。循环全球可见性 ()

I am way late to the party, but let us add a simple way for posterity. Simply use Cycle Global Visibility (<backtab>). If your headings are open, it will close them. However, if you apply it repeatedly with all headings collapsed, they will open to the level you want.

I use it from the keyboard by <SHIFT>+<TAB>. You can also find it in the Org menu (in Emacs) under Show/Hide -> Cycle Global Visibility ()

弥繁 2024-11-18 18:24:19

如果 M. Kullman 的答案中的前缀参数占用了您太多的心智能力(当您同时认真思考其他事情时,资源是有限的),那么您可以使用以下函数来扩展合同标题

(defvar hf-org-depth-point nil)
(defvar hf-org-depth-depth nil)

(defun hf-org-depth-increase ()
   (interactive)
   (hf-org-depth-incr 1))

(defun hf-org-depth-decrease ()
    (interactive)
    (hf-org-depth-incr -1))

(defun hf-org-depth-incr (incr)
    (when (not (equal (point) hf-org-depth-point))
        (setq hf-org-depth-point nil)
        (setq hf-org-depth-depth 0))a
    (setq hf-org-depth-point (point))
    (setq hf-org-depth-depth (max (+ hf-org-depth-depth incr) 0))
    (hide-subtree)
    (show-children hf-org-depth-depth))

```

If the prefix arguments from M. Kullman's answer take too much mental capacity for you (a limited resource when you are thinking hard about something else at the same time) then you can use the following functions to expand contract headings

(defvar hf-org-depth-point nil)
(defvar hf-org-depth-depth nil)

(defun hf-org-depth-increase ()
   (interactive)
   (hf-org-depth-incr 1))

(defun hf-org-depth-decrease ()
    (interactive)
    (hf-org-depth-incr -1))

(defun hf-org-depth-incr (incr)
    (when (not (equal (point) hf-org-depth-point))
        (setq hf-org-depth-point nil)
        (setq hf-org-depth-depth 0))a
    (setq hf-org-depth-point (point))
    (setq hf-org-depth-depth (max (+ hf-org-depth-depth incr) 0))
    (hide-subtree)
    (show-children hf-org-depth-depth))

```

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文