Created
March 17, 2011 10:17
-
-
Save antonj/874106 to your computer and use it in GitHub Desktop.
Emacs command to toggle folding of all lines with indentation larger than that on the current line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun aj-toggle-fold () | |
"Toggle fold all lines larger than indentation on current line" | |
(interactive) | |
(let ((col 1)) | |
(save-excursion | |
(back-to-indentation) | |
(setq col (+ 1 (current-column))) | |
(set-selective-display | |
(if selective-display nil (or col 1)))))) | |
(global-set-key [(M C i)] 'aj-toggle-fold) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment