On Mon, 12 Mar 2012, Efraim Yawitz wrote:
On Sun, Mar 11, 2012 at 6:53 PM, Benjamin R. Haskell wrote:
On Sun, 11 Mar 2012, Efraim Yawitz wrote:
Hi,
I've looked around the help and archives, but I can't find anything
about this problem:
How do I set netrw so that when I do :e http://someurl.html, vim
displays it as raw HTML code rather than formatting it like a
browser?
It sounds like your g:netrw_http_cmd or g:netrw_http_xcmd is
misconfigured or pointing to something undesirable. Netrw shouldn't
do what you're describing by default. If you have `curl` or `wget`
available, I'd add:
let g:netrw_http_cmd = 'curl'
or:
let g:netrw_http_cmd = 'wget'
to your .vimrc. I've had problems in the past trying to get raw HTML
out of certain versions of `links`/`elinks`. (Both of them seem like
bad default choices for fetching raw HTML, considering there are at
least three different forks of `links`/`elinks`, each of which
behaves differently.)
Yes, that is the problem. However, it only worked when I set
g:netrw_http_cmd = 'curl' rather than 'curl -o' as it says in the
help. Also, 'wget -q -O' or even just 'wget ' didn't work. All this
is on a Linux machine at home. At work, I'm running vim on Windows
and g:netrw_http_cmd is automatically set to 'curl -o' and works fine.
What's the difference?
Perhaps your version of Netrw is older? In my version (distributed w/
7.3.322, :help pi_netrw says "Last change: 2010 Jul 28"), it seems to
use two options for http: URLs:
g:netrw_http_cmd, which you'd set to the program you want to use (e.g. 'curl').
And:
g:netrw_http_xcmd, which holds the options for that program (e.g. '-o'
for 'curl' or '-q -O' for 'wget'), and which is automatically set to an
appropriate value if you're using a recognized program.
--
Best,
Ben
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php