Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding markup elements in org-mode

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.

like image 751
Mirzhan Irkegulov Avatar asked Jun 10 '12 14:06

Mirzhan Irkegulov


3 Answers

Try:

(setq org-hide-emphasis-markers t)

or set it via customize:

M-xcustomize-variableRETorg-hide-emphasis-markersRET

like image 136
Keith Flower Avatar answered Nov 12 '22 07:11

Keith Flower


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.

like image 3
Johannes Wasmer Avatar answered Nov 12 '22 06:11

Johannes Wasmer


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)
like image 2
Micah Elliott Avatar answered Nov 12 '22 07:11

Micah Elliott