axieax / urlview.nvim

🔎 Neovim plugin for viewing all the URLs in a buffer
MIT License
232 stars 5 forks source link

Feature request: view urls on current line or select lines #45

Closed linrongbin16 closed 1 year ago

linrongbin16 commented 1 year ago

Hi, thanks to this plugin first. I use it a lot.

there are many times, my cursor is on a line with url. And I want to open it.

please support view urls on current line or select lines.

axieax commented 1 year ago

Hi, thanks to this plugin first. I use it a lot.

Hi glad to hear this :))

Regarding this feature, just wondering which solution would better address your use case:

  1. Navigate to the desired url with [u and ]u for the previous and next URL relative to the cursor, then use gx to open the URL in the browser directly (my preferred solution and what I use in my workflow). This allows for more granular control over which URL I want to browse.
  2. Registering a custom search context which is similar to search.buffer but uses a modified search_helpers.get_buffer_content function with the same search_helpers.content function for extracting URLs from the selected content. This will allow you to display the URLs in the current line, or a visual selection, which I think is more what you want. I think it would be best for something like this to be a custom search context in order to keep this plugin lightweight (but still extensible), but I can add it here for others to use as well :))
linrongbin16 commented 1 year ago

The first one would work for me. I feel I missed something and need to read your doc again.

axieax commented 1 year ago

Great to hear! Feel free to reopen if you have anymore issues or suggestions!