In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.
Is there a way for markdown mode to have active hyperlinks as well?
In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.
Is there a way for markdown mode to have active hyperlinks as well?
This isn't easy enough to find, but what you want is goto-address-mode. You can activate it in the current buffer with M-x goto-address-mode
or you can add it to markdown-mode-hook:
(defun turn-on-goto-address-mode ()
(goto-address-mode 1))
(add-hook 'markdown-mode-hook #'turn-on-goto-address-mode)
In the current development version of Markdown mode, links are now clickable without requiring any additional libraries. URLs can also be hidden, and you can hover your mouse pointer to see the URL and optional title text.
Answering my own question, here's the setup I use now to make clickable hyperlinks in prog-mode (useful for URLs within comments) and text-mode (which includes markdown).
(use-package goto-addr
:bind
(:map goto-address-highlight-keymap
("C-c C-o" . goto-address-at-point))
:hook ((prog-mode . goto-address-prog-mode)
(text-mode . goto-address-mode)))
In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.
Yes this can be done without any additional code.
The format in which you have enter URLs in org-mode
file is
[[http://www.google.co.in][Google India]]
. This will open the webpage (in your default browser) on a click event.
This is how it looks in my org file
Manual reference