2

I am using [[LINK][DESCRIPTION]] format to define hyperlinks in org-mode.

Org recognizes plain URIs, possibly wrapped within angle brackets, and activate them as clickable links. The general link format, however, looks like this:

[[LINK][DESCRIPTION]]

When I write [[LINK][DESCRIPTION]] it automatically becomes DESCRIPTION. Would it be possible keep it as its expanded version where I can see the URL as well in the buffer?

3
  • 1
    C-h v org-link-descriptive: customize the variable and set it to nil.
    – NickD
    Commented Nov 25, 2021 at 1:15
  • @NickD Thanks it was exactly what I was looking for. Would it be possible to set org-link-descriptive true and nil (toggle in between) via keybinding?
    – alper
    Commented Nov 25, 2021 at 13:16
  • Yes, of course: since nobody has really answered yet, you can add it to your question (as a general rule, modifying questions after the fact - except for clarifications and fixing typos - is highly discouraged). I'll answer when I find the time, unless somebody beats me to it.
    – NickD
    Commented Nov 25, 2021 at 15:07

1 Answer 1

3

The operative variable is org-link-descriptive (it was called org-descriptive-links in earlier versions of Org mode). Its doc string (C-h v org-link-descriptive says:

Non-nil means Org displays descriptive links.

E.g. [[https://orgmode.org][Org website]] is be displayed as "Org Website", hiding the link itself and just displaying its description. When set to nil, Org displays the full links literally.

You can interactively set the value of this variable by calling ‘org-toggle-link-display’ or from the "Org > Hyperlinks" menu.

That simultaneously answers the question in the question and the additional question in a comment about using a function to toggle it. The only additional thing to do is to add a keybinding:

(define-key org-mode-map (kbd "C-c z") #'org-toggle-link-display)

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.