-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Opening hyperlinks externally #578
base: master
Are you sure you want to change the base?
feat: Opening hyperlinks externally #578
Conversation
Is Also, does Emacs have a way to provide this custom executable for opening things? I didn't find anything in the docs, only some custom functions that allow this https://emacs.stackexchange.com/questions/57506/open-file-in-orgmode-with-external-application-check-if-file-exists-and-create |
|
Renamed I could also give implementing user-defined links a shot, if this is desired functionality. |
Added an option replicating what is described in Adding Hyperlink Types, or at least a way of describing how to follow links:
This allows the user to define any prefix in a table and give it any kind of handler one would want. |
9094379
to
abff0dc
Compare
44754e8
to
5143eed
Compare
@kristijanhusak, @jgollenz What should we do with this PR? Actually I would like to have the possibility to open file links from orgmode with XDG_OPEN (e.g. PDFs, images), because it doesn't make any sense to open them in Neovim as text. I am used to reference PDFs in my notes, but these links are currently only of little use. While I already thought to implement something myself, I found this open PR, which looks promising. |
@seflue we will probably close this. |
@seflue nothing to add from my part, except a sincere sorry to @maidl0ver for the radio silence on this MR. |
I wasn't aware how much you actually refactored autocompletion - this just looks much more structured and extendable then what I remember from when I did my first refactoring on hyperlinks. |
Hey, I'm looking forward to this possibly landing in orgmode. A note I'd love to make is how orgmode has the hyper link types (which you can see here). If the refactor could in some way include adding hyperlink types, that would be awesome. That would also (I imagine) give direction towards custom link transformation when exporting a pdf (which you can see here). These are some powerful org-mode utils. |
This is a stab at #563 and #506.
<Leader>oo
now opens linked files withxdg-open
.There is also an option to specify
custom:
links, which I would like to read your thoughts on:Issues
This functionality depends on nvim's
vim.filetype.match()
behaviour, which returnsnil
on unrecognized filetypes inferred from the filename. The issue with this is that some plaintext (i.e..txt
or files without an extension) would be opened externally. Directories are also treated as externally openable (#556). If this is not desired behaviour for directories, this could be fixed by checking the type withvim.loop.fs_stat
and made configurable.