43

There are plenty structural markup elements in org-mode like *bold* or /italic/, but they are visible in the org-mode text, which is good, if the file is intended for export, and bad, if it is intended for semi-WYSIWYG editing. I want to hide these markup symbols, so the *bold* becomes bold, just like links hide their square brackets.

Is that possible in org-mode out of the box? If not, then please suggest an elisp code, that can solve this problem.

3 Answers 3

64

Try:

(setq org-hide-emphasis-markers t)

or set it via customize:

M-xcustomize-variableRETorg-hide-emphasis-markersRET

0
3

In case you're using Spacemacs, you can also toggle this with M-RET T V (toggles space-doc-mode). It hides org-mode emphasis markers and meta tags, among other things. For a full description, see e.g. SPC h f space-doc-mode.

0
2

I like to show/hide these often. It you want to make it a simple toggle, put this in your init.el to get a C-c e binding:

(defun org-toggle-emphasis ()
  "Toggle hiding/showing of org emphasize markers."
  (interactive)
  (if org-hide-emphasis-markers
      (set-variable 'org-hide-emphasis-markers nil)
    (set-variable 'org-hide-emphasis-markers t)))
(define-key org-mode-map (kbd "C-c e") 'org-toggle-emphasis)
3
  • 3
    Is it me or does this require re-visiting the file?
    – Arktik
    Dec 16, 2020 at 13:11
  • 5
    @A.Blizzard Same problem. I add (org-mode-restart) to the end of this function and now I don't need to refresh to see the change
    – Lesley Lai
    Dec 29, 2020 at 4:12
  • 9
    @Lesley Lai, also could try toggling visible-mode. I found it quite useful.
    – Arktik
    Jan 5, 2021 at 15:27

Your Answer

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

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