Skip to main content
outline-regexp is no longer a defcustom in Emacs 24.4
Source Link

This feature exists in Emacs. Outline mode describes a document as containing heading lines with a level, and has facilities to move among levels. We can define every line as a heading line with a level that reflects its indentation: set outline-regexp to the indentation. More precisely, the indentation plus the first non-whitespace character (and the beginning of the file is the uppermost level): \`\|\s-+\S-.

M-x load-libray outline RET
M-x: (make-local-variable 'outline-regexp) RET
M-: (setq outline-regexp "\\`\\|\\s-+\\S-") RET
M-x outline-minor-mode RET

In Emacs 22.1–24.3 you can simplify this to:

M-x load-libray outline RET
M-1 M-x set-variable RET outline-regexp RET "\\`\\|\\s-+\\S-" RET
M-x outline-minor-mode RET

Then you can use outline motion commands:

  • C-C @ C-f (outline-forward-same-level) to move to the next sibling;
  • C-C @ C-b (outline-backward-same-level) to move to the previous sibling;
  • C-C @ C-u (outline-up-heading) to move to the parent.

One tab and one space count for the same amount of indentation. If you have a mix of tabs and spaces, set tab-width appropriately and call untabify.

If the current major mode has outline settings, they might conflict. In this case, you can use one of the many multiple major modes solution, the simplest being to create an indirect buffer and set it to Outline Major Mode. In Outline Major Mode, the default keyboard shortcuts are simpler to type: C-c C-f, etc.

This feature exists in Emacs. Outline mode describes a document as containing heading lines with a level, and has facilities to move among levels. We can define every line as a heading line with a level that reflects its indentation: set outline-regexp to the indentation. More precisely, the indentation plus the first non-whitespace character (and the beginning of the file is the uppermost level): \`\|\s-+\S-.

M-x load-libray outline RET
M-x make-local-variable RET outline-regexp RET
M-x set-variable RET outline-regexp RET "\\`\\|\\s-+\\S-" RET
M-x outline-minor-mode RET

Then you can use outline motion commands:

  • C-C @ C-f (outline-forward-same-level) to move to the next sibling;
  • C-C @ C-b (outline-backward-same-level) to move to the previous sibling;
  • C-C @ C-u (outline-up-heading) to move to the parent.

One tab and one space count for the same amount of indentation. If you have a mix of tabs and spaces, set tab-width appropriately and call untabify.

If the current major mode has outline settings, they might conflict. In this case, you can use one of the many multiple major modes solution, the simplest being to create an indirect buffer and set it to Outline Major Mode. In Outline Major Mode, the default keyboard shortcuts are simpler to type: C-c C-f, etc.

This feature exists in Emacs. Outline mode describes a document as containing heading lines with a level, and has facilities to move among levels. We can define every line as a heading line with a level that reflects its indentation: set outline-regexp to the indentation. More precisely, the indentation plus the first non-whitespace character (and the beginning of the file is the uppermost level): \`\|\s-+\S-.

M-x load-libray outline RET
M-: (make-local-variable 'outline-regexp) RET
M-: (setq outline-regexp "\\`\\|\\s-+\\S-") RET
M-x outline-minor-mode RET

In Emacs 22.1–24.3 you can simplify this to:

M-x load-libray outline RET
M-1 M-x set-variable RET outline-regexp RET "\\`\\|\\s-+\\S-" RET
M-x outline-minor-mode RET

Then you can use outline motion commands:

  • C-C @ C-f (outline-forward-same-level) to move to the next sibling;
  • C-C @ C-b (outline-backward-same-level) to move to the previous sibling;
  • C-C @ C-u (outline-up-heading) to move to the parent.

One tab and one space count for the same amount of indentation. If you have a mix of tabs and spaces, set tab-width appropriately and call untabify.

If the current major mode has outline settings, they might conflict. In this case, you can use one of the many multiple major modes solution, the simplest being to create an indirect buffer and set it to Outline Major Mode. In Outline Major Mode, the default keyboard shortcuts are simpler to type: C-c C-f, etc.

Source Link

This feature exists in Emacs. Outline mode describes a document as containing heading lines with a level, and has facilities to move among levels. We can define every line as a heading line with a level that reflects its indentation: set outline-regexp to the indentation. More precisely, the indentation plus the first non-whitespace character (and the beginning of the file is the uppermost level): \`\|\s-+\S-.

M-x load-libray outline RET
M-x make-local-variable RET outline-regexp RET
M-x set-variable RET outline-regexp RET "\\`\\|\\s-+\\S-" RET
M-x outline-minor-mode RET

Then you can use outline motion commands:

  • C-C @ C-f (outline-forward-same-level) to move to the next sibling;
  • C-C @ C-b (outline-backward-same-level) to move to the previous sibling;
  • C-C @ C-u (outline-up-heading) to move to the parent.

One tab and one space count for the same amount of indentation. If you have a mix of tabs and spaces, set tab-width appropriately and call untabify.

If the current major mode has outline settings, they might conflict. In this case, you can use one of the many multiple major modes solution, the simplest being to create an indirect buffer and set it to Outline Major Mode. In Outline Major Mode, the default keyboard shortcuts are simpler to type: C-c C-f, etc.