5

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?

bph
  • 257
  • 1
  • 5
  • Possibly duplicate of: https://emacs.stackexchange.com/questions/967/simulating-mouse-operations-with-keyboard – melissa_boiko Apr 25 '17 at 10:29
  • The accepted answer below is simpler and specific to org mode, so slightly different to the linked duplicate – bph Apr 25 '17 at 11:26

1 Answers1

9

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.

JeanPierre
  • 7,323
  • 1
  • 18
  • 37
  • 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