在 emacs org-mode 中仅延迟加载前 N 行
有没有办法告诉 org-mode 仅加载长文本文件的前 N 行?我想保持整个文件打开以便能够搜索它,但在文件的前 N 行上显示组织模式,这是我编辑新内容的地方。
Is there a way to tell org-mode to load only the first N lines of a long text file? I would like to keep the whole file open to be able to search through it, but have org-mode display on the first N lines of my file, which is where I edit new content.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在组织模式下有结构化大纲,则可以使用
#+STARTUP
标记设置全局文件可见性,或使用VISIBILITY
属性设置任何标题的可见性,有关详细信息,请参阅可见性循环。使用内置组织模式属性的好处是可以轻松地以您想要的状态打开文件。我设置了我的日志文件来完成类似的事情,我认为您要求使用这些组织模式属性。 “今天”部分已打开,因此我可以看到所有内容,但较旧的档案已折叠。
If you have a structured outline in org-mode, you can set the global file visibility with the
#+STARTUP
markup, or the visibility of any heading with theVISIBILITY
property, see Visibility Cycling for details. The benefit of using the built-in org-mode properties is that it's easy to have a file open up in exactly the state you want.I have my journal file set up to accomplish something similar what I think you're asking for using these org-mode properties. The "Today" section is opened so I can see everything, but older archives are collapsed.
我不确定标题是否真的符合描述?
我认为您只想使用缓冲区缩小,它可以让您根据需要隐藏指定区域之外的所有内容。
您可以通过标记区域并键入 Cxnn 来手动缩小缓冲区。
使用 Cx< 将显示加宽至完整缓冲区/kbd>nw
我想您可以使用
eval
局部变量将其自动化到预定义区域,如果你真的很想这么做。还有
narrow-to-defun
(Cxnd) 和narrow-to-page< /code> (Cxnp)。如果您在组织文件中添加分页符 (CqCl),后者可能会很方便。
I'm not sure the title really fits the description?
I think you just want use buffer narrowing, which lets you hide everything outside of the specified region for as long as necessary.
You can manually narrow the buffer by marking the region and typing C-xnn
Widen the display back to the full buffer with C-xnw
I guess you could use an
eval
Local Variable to automate this to a pre-defined region, if you really wanted to.There's also
narrow-to-defun
(C-xnd) andnarrow-to-page
(C-xnp). If you throw a page break into your org file (C-qC-l), the latter might prove handy.