yangnom
yangnom

Reputation: 247

How can I make Headings foldable in evil-mode in emacs?

In markdown-mode in insert mode, I can press tab and fold and unfold headings (lines prefixed with #s) but when I'm in normal mode, tab does nothing.

Is there anyway to make tab fold and unfold headings in a similar manner to the insert mode in normal mode?

Upvotes: 1

Views: 647

Answers (2)

Emad Elsaid
Emad Elsaid

Reputation: 323

Adding this binding to your configuration should allow tab key in normal mode to toggle fold

(define-key evil-normal-state-map (kbd "<tab>") 'evil-toggle-fold)

Upvotes: 0

manandearth
manandearth

Reputation: 824

When in normal mode Evil uses which ever folding package you have. (show-hide, origami, etc...).

You can then use z motions for folding/unfolding. (not <tab>)

For example:

  • za - evil-toggle-fold

  • zc - evil-close-fold

  • zr - evil-open-folds

  • zm - evil-close-folds

Upvotes: 3

Related Questions