5

When my cursor is on a URL that ends with a trailing slash, for example : http://www.google.com/

... if I type gx to open the link in my browser, curl is also called to download the webpage and the html code is displayed in a new buffer whose name is the URL ("http://www.google.com").

Is there a way to tell vim to only send the URL to the browser and not download the webpage ?

I don't know if it's related but I've set up the values of 2 global variables in my vimrc :

let g:netrw_gx="<cWORD>"
let g:netrw_browsex_viewer="xdg-open"

The first one is to prevent vim from sending only a part of the URL when it contains a ? or #.
The second one is to call a default program on my linux system when the cursor is on the path to a local file (instead of a web URL).

I'm using vim 7.4.899 and here's the output of vim --version.

2 Answers 2

2

Try netrw v155d ; it won't treat the url ending with a "/" as a file to be obtained. You can get it from http://www.drchip.org/astronaut/vim/index.html#NETRW .

1
0

I have the netrw version from Sep 19, 2016 and still encounter the same issue.

Instead of netrw, I use tyru's plugin to open a URL in the browser.

The plugin works great so far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.