1

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
  :init
  (setq markdown-asymmetric-header t
        markdown-hide-markup 1)
  :config
   (add-hook 'markdown-mode-hook
             '(lambda ()
                (setq markdown-hide-markup t)
                (visual-line-mode)
                ))
  (progn
    (with-eval-after-load 'markdown
      (markdown-toggle-markup-hiding))))
2
  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
  :init
  (setq-default markdown-hide-markup t))
  • That worked! Thank you very much :) – PlagueHammer Jan 2 '18 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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