Oct. 31st, 2011

hs-mode

Oct. 31st, 2011 10:49 pm
vlion: magical weaponized pony! (weaponized pony)
[personal profile] vlion
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

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:18 pm
Powered by Dreamwidth Studios