fox0430 / moe

A command line based editor inspired by Vim. Written in Nim.
https://editor.moe
GNU General Public License v3.0
629 stars 32 forks source link

Opening URI/URLs with xdg-open #765

Open tobimensch opened 3 years ago

tobimensch commented 3 years ago

When the cursor is under a URI/URLs in normal mode and the user presses gf (open file under cursor), moe should detect that the cursor is under a URI/URLs and open it with xdg-open. If the URI is on the local system and can be edited directly by moe, of course it should not use xdg-open and instead be opened by moe directly, for example file:///root/foobar.txt should be opened by moe. In other cases, like http://github.com/ or mailto://foo@bar.com xdg-open (or similar methods on other platforms) should be used to open this uri.

I also think this feature should be reflected in the syntax highlighting. When URI/URLs are detected under the cursor they should be underlined. I know it's possible to underline characters in the terminal, so this shouldn't be a big problem to get done.

fox0430 commented 3 years ago

@tobimensch

Good idea.