hs-mode

Oct. 31st, 2011 10:49 pm
vlion: magical weaponized pony! (weaponized pony)
[personal profile] vlion in [community profile] emacs
Hide-Show mode gives you the ability to code fold reasonably intelligently. Hit a key, fold the code. Hit a key, unfold the code. It's particular handy for Lisp use, I've noticed. I've been able to use it for Python as well.

Here's some snippets

(global-set-key "\M-`" 'hs-toggle-hiding)

(add-hook 'c-mode-common-hook 'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
(add-hook 'java-mode-hook 'hs-minor-mode)
(add-hook 'lisp-mode-hook 'hs-minor-mode)
(add-hook 'perl-mode-hook 'hs-minor-mode)
(add-hook 'sh-mode-hook 'hs-minor-mode)

Or, to start it, M-x hs-mode.


Reference: http://www.emacswiki.org/cgi-bin/wiki/HideShow

on 2011-11-02 08:38 pm (UTC)
Posted by [personal profile] tamouse
Neat!! Folding code isn't something I've done often, but when I need it, it's nice to know it's there!

Profile

emacs: Emacs Community Logo (Default)
emacs community

December 2011

S M T W T F S
    123
45678910
1112131415 1617
18192021222324
25262728293031

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 25th, 2017 10:28 pm
Powered by Dreamwidth Studios