Lazy loading only the first N lines in emacs org mode

Is there a way to tell org-mode to load only the first N lines of a long text file? I would like the whole file to be open in order to be able to search on it, but it has an org-mode display in the first N lines of my file, in which I am editing new content.

+6
source share
2 answers

If you have a structured outline in org-mode, you can set the global visibility of the file using the #+STARTUP markup or the visibility of any header with the VISIBILITY property, see Cycling Visibility . The advantage of using the org-mode built-in properties is that it is easy to open the file in the desired state.

I have a log file created to do something similar, which I think you are asking for is to use these org-mode properties. The Today section is open, so I see everything, but the old archives are collapsing.

+6
source

I'm not sure if the name really matches the description?

I think you just need to narrow the buffer narrowing, which allows you to hide everything outside the specified area for as long as necessary.

You can manually narrow the buffer by marking the area and typing Cx n n

Zoom to full buffer with Cx n w

I think you could use the local eval variable to automate this into a predefined area if you really wanted to.

There's also narrow-to-defun ( Cx n d ) and narrow-to-page ( Cx n p ). If you throw the page into your org ( Cq Cl ) file, the latter may be convenient.

+5
source

Source: https://habr.com/ru/post/891153/


All Articles