Skip to content

Instantly share code, notes, and snippets.

@LukeSmithxyz
Last active May 30, 2023 13:27
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LukeSmithxyz/94e6c01df3a67a6524dc38d2c92425d1 to your computer and use it in GitHub Desktop.
Save LukeSmithxyz/94e6c01df3a67a6524dc38d2c92425d1 to your computer and use it in GitHub Desktop.
Following Terminal Links with URLview

Following Terminal Links with URLview

Link handling

Specify what you want urlview to open your links with in ~/.urlview after COMMAND. I.e. the line below will make urlview open all urls in Firefox.

COMMAND firefox

I use this link handler to be run by urlview. This will open images in feh, movies/gifs in mpv on loop, will download .pdfs and music files and will open everything else in my browser.

Tell me how to improve this script, since I literally just threw it together a couple days ago.

Getting URLview built into some programs

Here are the configurations I have to get URLview working on some of my main terminal programs.

vim

This sets u to bring up urlview. IIRC it will give you all urls in the open document.

:noremap <leader>u :w<Home>silent <End> !urlview<CR>

newsboat/newsbeuter

urlview is a total life-saver in newsboat. I can browse even twitter feeds in the terminal with it with all multimedia. I map it to capital U here.

external-url-viewer "urlview"
bind-key U show-urls

mutt/neomutt

Again, I map urlview to capital U in mutt as well.

macro index,pager U "<enter-command>set pipe_decode = yes<enter><pipe-message>urlview<enter><enter-command>set pipe_decode = no<enter>""view URLs"
@lumpsoid
Copy link

@Benjman , @g4570n
it's kind late, but
now it's calling linkhandler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment