I use vim in the terminal as well as gvim. My issue is that in the terminal gx opens urls without a problem but in gVim nothing happens.

Has anyone else experienced this issue and found a fix?

I'm using gvim 7.4 with patches 1-52.

  • 2
    I don't know if it is relevant but maybe you should precise which OS you're using. Also I have the same behavior on a Debian with gVim 7.4. – statox Oct 8 '15 at 20:21

I just tried this on a debian with XFCE desktop environment and I can reproduce the issue. Turns out, that gvim calls xdg-open URL to open the URL, but unfortunately, this did not return anything or display an error message.

However, I could fix this, by using setsid xdg-open which you need to set for the g:netrw

:let g:netrw_browsex_viewer="setsid xdg-open"

Bug opened with XFCE

  • Thanks for this. I'm on Ubuntu with Gnome so I made a slight change: let g:netrw_browsex_viewer="setsid gnome-open" – moorej Oct 8 '15 at 21:35
  • 3
    Could you please explain why setsid fixes the problem? Thanks! – Vitor Oct 9 '15 at 14:53
  • Same happens on Ubuntu 17.10 GNOME. – Ciro Santilli新疆棉花TRUMP BAN BAD Nov 28 '17 at 5:45
  • Ubuntu 18.04: When I use the setting with setsid it pulls the html doc into the gvim window. When I use let g:netrw_browsex_viewer= "gnome-open" just a screen flicker no browser. When I use gnome-open from bash works fine, so what's the problem with Ubuntu gnome? – John Meyer Aug 25 '18 at 17:17

I'm on OS X and running the following command in vim worked for me:

let g:netrw_browser_viewer='open'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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