Skip to content

Instantly share code, notes, and snippets.

@antonj
Created March 17, 2011 10:17
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonj/874106 to your computer and use it in GitHub Desktop.
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.
(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