View and access Phoenix routes using Telescope.nvim.
Install the plugin with your preferred package manager.
-- lazy.nvim
{
'dinocosta/telescope-phx-routes.nvim',
dependencies = { 'nvim-telescope/telescope.nvim' }
}
After installation you simply need to load the extension with:
require('telescope').load_extension('phx-routes')
The extension can easily be run with the :Telescope
command:
:Telescope phx-routes routes
Or, more conveniently, you can create a mapping for it. In this example, space + p + r
is used:
vim.api.nvim_set_keymap(
"n",
"<space>pr",
":Telescope phx-routes routes<CR>",
{ noremap = true }
)