atom/link

Feature Request: ctrl + click to open link

MasseGuillaume opened this issue ยท 20 comments

I think it's a pretty classic shortcut

For mac users (at least me) cmd+click would be more natural, but rebinding mouse seems to be an issue of core. atom/atom#2256

๐Ÿ‘

Totally agree. I think the default keybinding should vary by platform - Cmd+Click for Mac, Ctrl+Click for everyone else.

๐Ÿ‘ I agree, this should be an option.

You should have 2 options:

  • ctrl + left/middle/right click (ctrl should be configurable too)
  • any keyboard shortcut (no mouse clicks)

You should be able to enable mouse clicks in the settings of the plugin.

ctrl+shift+o AND having your mouse in a nice spot is pretty obtuse to say the least. Baffling, honestly. Please make this more in line with every other program on earth that supports opening links. ctrl+click, ctrl+alt+click, etc.

nuest commented

๐Ÿ‘

one of the major missing feature to use Atom as markdown general editor..
what can we do to speed up this patch?

timdp commented

URLs already have the hyperlink class in the DOM, so I imagine this wouldn't be too hard to implement?

Is there a package that does this?

timdp commented

@UziTech There's this PR by @marshall007 but it never got merged. The patch itself appears to be two lines so I don't think there's any real need to turn it into a package. Rather, it'd be great if it could be added into atom-link itself.

@timdp you or anyone else should feel free to submit a PR using that code. I've been running the patched version locally and it works. Just wasn't sure how to write a test for it.

timdp commented

Sounds like we need someone who knows how to test this then. :-) Presumably, we'll emit a synthetic click event and see if the listener fired rather than jumping through hoops to check for an open browser window. Maybe just stub the open function with sinon and check its call count?

timdp commented

Correction: keypress instead of click. Still having my morning coffee.

I just made a small package that uses hyperclick called hyperlink-hyperclick

it's not quite finished but it works

Since Cmd/Ctrl+Click is also used to create additional cursors, this change would prevent people from manually creating additional cursors in a hyperlink. We think having this feature implemented as a community package makes the most sense because then people can decide which feature they value more.

Thanks everyone for your comments and thanks @UziTech for creating the hyperlink-hyperclick package! โœจ

Is there any way of turning this off? It's getting in the way of me using cmd + click to multi select

@grubstarstar this package doesn't have this feature. If you have hyperlink-hyperclick installed you can just disable the package to prevent this behavior

I didn't have that, but it seemed to be a setting in Facebook's nuclide. Thanks for pointing me in the right direction though.

I installed both hyperclick called hyperlink-hyperclick but it doesn't work (links aren't clickable)

hyperlink-hyperclick works with hyperclick or atom-ide-ui. you will have to hold ctrl/cmd then hover over the url and the url should become underlined which indicates that it is clickable.

hyperlink-hyperclick screenshot

Thanks for your reply UziTech , but that doesn't work for me (but click-link does)