File: links-custom-links+viewer.html, Node: Using Links as a HTML Viewer, Next: Appendices, Prev: ...External Applications, Up: Customizing...

# 3.4 Using Links as a HTML Viewer

# [Version 0.82]

These examples show how to get Links to run as an external HTML viewer.

### Page Contents

- 3.4.1 Vim and Links
- 3.4.2 Mutt and Links (and the Mailcap file)

### 3.4.1 Vim and Links

Source: <ftp://ftp.vim.org/pub/vim/MIRRORS>

"Vim is an almost 100% compatible version of the UNIX editor Vi. Many new features have been added: Multi level undo, syntax highlighting, command line history, filename completion, block operations, etc."

Vim should compile on all systems that Links runs on.

If you use Vim as an HTML editor, setting up Links as an HTML viewer means that you can view the rendered swap file without having to save the file and refresh Links.

To get Vim to use Links as an HTML viewer, add one (or both) of the following lines to your ".vimrc" file:

map <F2> :!links file://%<CR>

command View :!links file://%

where :! invokes an external shell command, links file:// is the Links binary and the localfile prefix, and % is expanded to the current swap file name. Note: if you are using the bashscript included in the appendix [], use the real Links binary name (e.g. "links-0.82") otherwise Links in X will be started -- much more slowly -- in a new xterm each time.

The former entry maps a user command to the <F2> key; while the latter is a user command that can be invoked with :V.

Whenever you want to view the current swap file in rendered HTML, just press the command key and Links will invoke in Vim's current terminal. To exit Links and return to Vim, press ^C.

### 3.4.2 Mutt and Links (and the Mailcap file)

Source: <http://www.mutt.org/download.html>

"Mutt is a small but very powerful text based program for reading electronic mail under unix operating systems, including support color terminals, MIME, and a threaded sorting mode."

If you use a text based mail programme like Mutt, you can use Links as an external HTML viewer that can be invoked when an HTML attachment is selected.

For Mutt, add the following line to your local mailcap file (usually ~/.mailcap),

text/html; /usr/local/bin/links-0.82 %s

In your ".muttrc" make sure that the set mailcap_path includes your local mailcap file path.

Note: The auto_view option in Mutt 1.0i (1999-10-22) does not work with Links. This "bug" will be investigated further for the next version of this manual.

To invoke Links to view an HTML file from Mutt, use the "(v)iew attachments" key and select the HTML file. Links will start and display the file. To exit Links (and return to Mutt), press ^C.

User Reference Manual for Links Version 0.82 | Revision Date: 2000-02-16

Copyright (C) 2000 Cliff Cunnington, <cliff@ccnet.demon.nl>

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.