Wikia

Vim Tips Wiki

Using elinks with netrw

Talk0
1,599pages on
this wiki
Revision as of 09:34, March 26, 2009 by JohnBeckett (Talk | contribs)

Recently created tip

We have not yet decided whether to keep this tip as its own page or merge it somewhere else. If you have a suggestion on the tip content, please edit this page or add your comments below (do not use the discussion page).

Please discuss whether to keep this as a new tip, or whether to merge it into an existing tip, on the new tips discussion page.
created July 25, 2008 · complexity basic · author Emallove · version 7.0

The Vim Netrw plugin allows one to view the contents of an http hyperlink via CTRL-W_CTRL-F. Netrw checks the user's system (in this order) for curl, wget, and fetch. Text browsers such as elinks and links are better alternatives to HTTP clients like curl because they have a -dump option which strips out the HTML tags and formats tables for improved ASCII viewing. Getting these text-based web browsers working with Netrw requires a simple wrapper script to format the arguments in the order that Netrw provides them:

$ agent tempfile url

Here is a sample wrapper script for elinks (in a file named elinks-for-vim).

#!/bin/sh
tempfile=`echo $* | awk '{print $1}'`
url=`echo $* | awk '{print $2}'`
elinks -dump $url > $tempfile

Then, add this line to your vimrc:

let g:netrw_http_cmd = "elinks-for-vim"

See also

Comments

Advertisement | Your ad here

Photos

Add a Photo
103photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki