I'd like to hide the markup in my Markdown buffers. I can do that manually using markdown-toggle-markup-hiding. However I'd like to configure this once and for all in my init.el so that I don't have to do this manually every time.

I tried setting markdown-hide-markup to 1, but it doesn't work. I believe I'm missing something here in my use-package configuration.

If anyone knows a fix, can you let me know?

Here are the things I've tried that do not work.

;; Markdown Mode
(use-package markdown-mode
  :ensure t
  (setq markdown-asymmetric-header t
        markdown-hide-markup 1)
   (add-hook 'markdown-mode-hook
             '(lambda ()
                (setq markdown-hide-markup t)
    (with-eval-after-load 'markdown

1 Answer 1

  1. markdown-hide-markup needs to be set before markdown mode starts, so the markdown-mode-hook probably doesn't do anything. But it's buffer-local, so I think you need to use setq-default instead of setq.
  2. You set markdown-hide-markup to t, and then you toggle it, which might be turning it off. Not sure.

This works for me:

(use-package markdown-mode :ensure t
  (setq-default markdown-hide-markup t))
  • That worked! Thank you very much :)
    – Debajit
    Jan 2, 2018 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.