axieax / urlview.nvim

πŸ”Ž Neovim plugin for viewing all the URLs in a buffer
MIT License
232 stars 5 forks source link
collaborate hacktoberfest neovim neovim-plugin nvim nvim-plugin

πŸ”Ž urlview.nvim

Find and display URLs from a variety of search contexts

Neovim Version Repo Stars Repo Size

✨ UrlView is an extensible plugin for the Neovim text editor which essentially:

  1. Finds URLs from a variety of search contexts (e.g. from a buffer, file, plugin URLs)
  2. Displays these URLs in a picker, such as the built-in vim.ui.select or telescope.nvim
  3. Performs actions on selected URLs, such as navigating to the URL in your preferred browser, or copying the link to your clipboard

🎯 Additional features and example use cases include:

Please note that currently, this plugin only detects URLs beginning with a http(s) or www prefix for buffer and file search, but there are plans to support a more general pattern (see πŸ—ΊοΈ Roadmap).

πŸ“Έ Screenshots

πŸ“‹ Buffer Links

:UrlView or :UrlView buffer

buffer-demo

πŸ”Œ Plugin Links

:UrlView lazy, :UrlView packer, or :UrlView vimplug depending on your plugin manager of choice

packer-demo

⚑ Requirements

πŸš€ Usage

Searching contexts

  1. Use the command :UrlView to see all the URLs in the current buffer.
  1. You can optionally select a link to bring it up in your browser.

Buffer URL navigation

  1. You can use [u and ]u (default bindings) to jump to the previous and next URL in the buffer respectively.
  2. If desired, you can now press gx to open the URL under the cursor in your browser, with netrw.
  3. This keymap can be altered under the jump config option.

πŸ“¦ Installation

Install this plugin with your package manager of choice. You can lazy load this plugin by the UrlView command if desired.

use("axieax/urlview.nvim")
"axieax/urlview.nvim"

βš™οΈ Configuration

This plugin supports plug-n-play, meaning you can get it up and running without any additional setup.

However, you can customise the default options using the setup function:

require("urlview").setup({
  -- custom configuration options --
})

Please check out the documentation for configuration options and details.

🎨 Pickers

βœ”οΈ Native (vim.ui.select)

You can customise the appearance of vim.ui.select with plugins such as dressing.nvim and telescope-ui-select.nvim. In the demo images above, I used dressing.nvim's Telescope option, which allows me to further filter and fuzzy search through my entries.

πŸ”­ Telescope

🚧 Stay Updated

More features are continually being added to this plugin (see πŸ—ΊοΈ Roadmap). Feel free to file an issue or create a PR for any features / fixes :)

It is recommended to subscribe to the πŸ™‰ Breaking Changes thread to be updated on potentially breaking changes to this plugin, as well as resolution strategies.