How to jump to links and open it in Mutt

3

I just started using Mutt. How can I jump to a link and next link and so on in Mutt? And how to open in in w3m?

Thanks in advance.

shinokada

Posted 2013-12-31T03:43:23.590

Reputation: 1 635

Answers

2

Mutt doesn't have the ability to follow links itself, but you can have Mutt run some external tools that will do so.

One is urlview. You can execute it while viewing an HTML message in Mutt's pager by typing Ctrl-B, which is bound by default to a macro that runs urlview. That will display a menu of the links in the message, allowing you to jump from there to a link's target using your preferred browser.

I prefer to use w3m for that purpose because it shows the links in the context of the message, so I have this macro defined in my muttrc:

macro index,pager \cB ": unset wait_key; set pipe_decode\n|w3m\n: set wait_key; unset pipe_decode\n" "call w3m to extract URLs out of a message"

Because this macro sends plain text rather than HTML to w3m, you have to tell w3m to convert anything that looks like a link to an actual link by typing :.

If the message is HTML, or has an HTML part, you can view that part using w3m instead of Mutt's pager by using the attachment menu, bound to v by default. If your mailcap file is configured properly, selecting the HTML part of the message in that menu and hitting Enter will launch w3m to display the message. Then you can follow links as you normally do when browsing with w3m.

By a properly-configured mailcap file, I mean one containing a line like this:

text/html; w3m %s; nametemplate=%s.html

This explanation, along with more about using Mutt, can be found here and here.

garyjohn

Posted 2013-12-31T03:43:23.590

Reputation: 29 085