Questions tagged [hideshow]

hs-minor-mode is a builtin minor mode to selectively hide or show (fold/unfold) parts of code.

hs-minor-mode is just one code folding mode, other notable modes with folding capacity are:

  • outline
  • folding
  • evil-mode
  • yafolding
  • origami
  • fold-this
31 questions
10
votes
4 answers

Hide lines by regex

I am reading detailed line oriented log file (100MB). I want to skip some parts by using regex. Usually I M-x flush-lines but this is destructive operation. I want to hide many lines by regex and expect it would be efficient when I navigate across…
gavenkoa
  • 3,452
  • 20
  • 37
7
votes
1 answer

Folding up URLs

I am editing a document with lots of URLs in it, and I would like to automatically fold them down to just the last part of the URL so that they take up less room on the line, similar to the way hideshow folds up blocks of code. For…
castle-bravo
  • 283
  • 1
  • 4
3
votes
1 answer

hiding and showing all blocks with one binding

I want to combine the commands hs-hide-all and hs-show-all. It would be great if I'd have a function that detects the "status" of all blocks. If there are blocks that aren't hidden, the function should hide them, thus all blocks are hidden. Applying…
bertfred
  • 1,729
  • 1
  • 12
  • 24
2
votes
1 answer

hs-minor-mode and sage-shell-mode (derived from python-mode)

I would like to use emacs' hide-show mode (to collapse class and function definitions) with Sho Takemori's sage-shell-mode (for the SageMath computer algebra system) which derives from python-mode. Although emacs does not complain when I do M-x…
1
vote
1 answer

How does this forward-sexp-function in hs-special-mode-alist work?

I wanted to look up the different hs-special-mode-alist forward-sexp functions for inspiration to create my own and this is what the python forward-sexp looks like on my setup: ;; (MODE START END COMMENT-START FORWARD-SEXP-FUNC…
The Unfun Cat
  • 2,413
  • 17
  • 32
0
votes
1 answer

How to make hideshow (hs-toggle-hiding) delimit blank lines for comments?

When using hideshow (specifically hs-hide-initial-comment-block), I often run into the problem where the very first comment is a license block, followed by a more detailed comment on the purpose of the file. For example: /* * This program is free…
ideasman42
  • 8,786
  • 1
  • 32
  • 114
0
votes
2 answers

Hide/fold matching braces in text mode

I have free-form text logs with JSON-ish objects that I would like to selectively hide when analyzing the logs. They look something like this 2018-10-09 09:47:34.269 [T] T { 2018-10-09 09:47:34.269 [T] T { 2018-10-09 09:47:34.269 [T] T …
Per Knytt
  • 103
  • 3
0
votes
1 answer

How can I configure hideshow to hide comments in longer programs only?

If I start Emacs 25 with an init file (.emacs) containing (package-initialize) (load-library "hideshow") (add-hook 'python-mode-hook (lambda () (hs-minor-mode 1)) ) (setq hs-minor-mode-hook 'hs-hide-initial-comment-block) then the initial comments…
Calaf
  • 483
  • 3
  • 16