LoginSignup
3
3

More than 5 years have passed since last update.

折り畳み表示する見出しレベルを切り返えるコマンド

Posted at

以前、markdown-mode の折りたたみ表示機能 - わからん というブログ記事を書きました。# の見出しだけを表示, # と ## の見出しだけを表示, # と ## と ### の見出しだけを表示、をクルクルと一つのコマンドで実行できると一覧性があがります。次のように実現してみました。

.emacs
    (make-variable-buffer-local 'my-outline-level)
    (setq-default my-outline-level 1)

    (defun my-global-cycle-md ()
      (interactive)
      (cond
       ((eq my-outline-level 1)
        (hide-sublevels 2)
        (setq my-outline-level 2))
       ((eq my-outline-level 2)
        (hide-sublevels 3)
        (setq my-outline-level 3))
       ((eq my-outline-level 3)
        (hide-sublevels 1)
        (setq my-outline-level 1))))
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3