π urlview.nvim
Find and display URLs from a variety of search contexts
β¨ UrlView is an extensible plugin for the Neovim text editor which essentially:
- Finds URLs from a variety of search contexts (e.g. from a buffer, file, packer.nvim and vim-plug plugin URLs)
- Displays these URLs in a picker, such as the built-in
vim.ui.select
or telescope.nvim - 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:
- Easily visualise all the URLs in a buffer or file (e.g. links in your Markdown documents)
- Quickly accessing repo webpages for installed Neovim plugins (life-saver for config updates or browsing plugin documentation)
- Ability to register custom searchers (e.g. Jira ticket numbers), pickers and actions (please see docs or
:h urlview.search-custom
) - Jumping to the previous or next URL in the active buffer
Please note that currently, this plugin only detects URLs beginning with a
http(s)
orwww
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
π Plugin Links
:UrlView lazy
, :UrlView packer
, or :UrlView vimplug
depending on your plugin manager of choice
β‘ Requirements
- This plugin supports Neovim v0.7 or later.
- Please find the appropriate *-compat Git tag if you need legacy support for previous Neovim versions, such as v0.6-compat for nvim v0.6, although these versions will no longer receive any new updates or features.
- For Neovim versions prior to v0.6 or Vanilla Vim support, please check out urlview.vim as an alternative plugin.
π Usage
Searching contexts
- Use the command
:UrlView
to see all the URLs in the current buffer.
-
For your convenience, feel free to setup a keybind for this using
vim.keymap.set
:vim.keymap.set("n", "\\u", "<Cmd>UrlView<CR>", { desc = "view buffer URLs" }) vim.keymap.set("n", "\\U", "<Cmd>UrlView packer<CR>", { desc = "view plugin URLs" })
-
You can also hit
:UrlView <tab>
to see additional contexts that you can search from- e.g.
:UrlView packer
to view links for installed packer.nvim plugins
- e.g.
- You can optionally select a link to bring it up in your browser.
Buffer URL navigation
- You can use
[u
and]u
(default bindings) to jump to the previous and next URL in the buffer respectively. - This keymap can be altered under the
jump
config option.
π¦ Installation
Free free to install this plugin manually or with your favourite plugin manager. As an example, using packer.nvim:
use("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
- Optional picker option
- Additional requirements (only if you're using this picker): telescope.nvim
- You can use Telescope as your
default_picker
using therequire("urlview").setup
function - Alternatively, you can specify a picker dynamically with
:UrlView <ctx> picker=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.