3

Is there a keyboard equivalent of left mouse click in emacs?

Use case here is an .org file I have which contains a no. of URLs

I can left click on those URLs to have them open in a browser

I was wondering whether there was a combination of key presses that would achieve the same, so I don't have to reach for the mouse?

6

Function org-open-at-point (bound to C-c C-o) does precisely that I think. Its docstring (obtained through M-x describe-function) includes:

(org-open-at-point &optional ARG REFERENCE-BUFFER)

Open link, timestamp, footnote or tags at point.

When point is on a link, follow it. Normally, files will be opened by an appropriate application. If the optional prefix argument ARG is non-nil, Emacs will visit the file. With a double prefix argument, try to open outside of Emacs, in the application the system uses for this file type.

...

Additionnaly, as mentionned by @Nick, the return key can be used instead of C-c C-o if variable org-return-follows-link is non-nil:

org-return-follows-link is a variable defined in ‘org.el’. Its value is nil

Documentation: Non-nil means on links RET will follow the link. In tables, the special behavior of RET has precedence.

  • you are absolutely correct! I've just tested and it works as expected, i.e. link opens as new tab in browser - I'll modify the OP to reflect that its specific to org mode.. – bph Apr 25 '17 at 11:22
  • 5
    See also the variable org-return-follows-link. If you set it to t, then RET follows the link (but not if the link is in a table). – NickD Apr 25 '17 at 11:50

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.