rmagatti / gx-extended.nvim

Extending the use of Neovim's `gx`
MIT License
31 stars 3 forks source link

Support visual selections #18

Closed reegnz closed 4 months ago

reegnz commented 8 months ago

The built-in gx supports navigating to a portion of the text that got selected in visual mode, gx-extended lacks that feature for passing on selected portion of the text extensions, it is currently only capable of sending the extensions the full line.

Eg. for the original gx if I have a URL in a line:

test url: https://github.com/rmagatti/gx-extended.nvim whatever trailing text

If I place the cursor on the URL and hit gx it opens the full URL. If I do a visual selection for only github.com it will open github.com

Would be cool to allow gx-ing with a visual selection, like performing a google search on it. Eg. I do a visual selection, then have extensions that are registered as being able to work in visual mode. Then have a google extension and a duckduckgo extension. When I select text, and hit gx, it would execute only the extensions supporting visual mode, then show me which URL I want to open (like it does in normal mode).

I'm open to contributing this feature as a PR.