chrishrb / gx.nvim

Implementation of gx without the need of netrw
Apache License 2.0
227 stars 23 forks source link

Support for Mac Deep links #57

Open lcfd opened 7 months ago

lcfd commented 7 months ago

Hi, I have a use case that I can't find in the documentation or in the issues:

Support for Mac Deep links like message:%3C....%3E.

Have you in program to support them?

I'm trying the plugin, and it works like a charm for all the rest πŸ’š. Thank you!

chrishrb commented 6 months ago

I also have a Mac but never had to use those deep links. What are those links, where to find them and where do they lead to?

lcfd commented 6 months ago

Hi @chrishrb, in the case I've mentioned deep links allow you to control/use applications on your Mac.

For example message:%3C....%3E will open the specified email in the mail app.

In the Neovim context, it's helpful to create "connections" between applications. For example, I'm saving email deep links so I can go directly to the email without searching it again.

Another example is the Bear application:

https://bear.app/faq/x-callback-url-scheme-documentation/

chrishrb commented 6 months ago

As I said - never heard of it. But sounds quite useful! πŸ‘ But this plugin currently only supports the browser app. I want to keep this plugin simple and small, so I donβ€˜t think this would make sense to implement here. Maybe you write an own plugin for this use case?

lcfd commented 6 months ago

Those are just links you can type in the browser, so it should be possible to support them without dealing with other applications than the browser.

I don't know if I'm correct or not, but I think it's just a matter of regexp.

If I'm over one of those links with the cursor and pressing gx it's enough that the plugin recognize them as URLs. At the moment it works only with https:// and all the rest is searched as a Google query. What if also {APP_NAME}:// is supported?

Maybe here: https://github.com/chrishrb/gx.nvim/blob/ea4cc715326a8bd060a450c24c3c9831cdee2f59/lua/gx/handlers/url.lua#L12

Does it make sense for you?