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
    Commented Oct 8, 2015 at 20:21

2 Answers 2


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
    Commented Oct 8, 2015 at 21:35
  • 4
    Could you please explain why setsid fixes the problem? Thanks!
    – Vitor
    Commented Oct 9, 2015 at 14:53
  • Same happens on Ubuntu 17.10 GNOME. Commented Nov 28, 2017 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
    Commented Aug 25, 2018 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 and acknowledge you have read our privacy policy.

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