Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using gvim 7.3.401 on archlinux. The shell command :!xdg-open doesn't open my default browser with that link. In fact, it appears to do nothing.

This works as expected within terminal vim

How can I make it work in gvim too?

share|improve this question
Both work fine for me on a Fedora 11 system, in that they both open that URL in Konqueror, although they both print an error message like this one: "<unknown program name>(25702)/ ClientApp::doIt: Creating ClientApp". Perhaps your environments differ between vim and gvim. Try executing ":!env > gvim_env" in gvim and ":!env > vim_env" in vim, then in the shell execute "vimdiff gvim_env vim_env" to see the differences. You may have to sort those files as well for the diff to make sense. – garyjohn Feb 6 '12 at 18:39
The only difference is vim_env has TERM=xterm, gvim_env TERM=dumb – Maxim Kim Feb 6 '12 at 19:47
It works on my debian squeeze box with gnome2, but not on my laptop with archlinux and gnome3 – Maxim Kim Feb 6 '12 at 20:02
I'm afraid I'm stumped then. Sorry I couldn't help. – garyjohn Feb 6 '12 at 20:46
up vote 8 down vote accepted

Try :!xdg-open &

I had the same issue until I saw how LaTeX-Box does it.

share|improve this answer
I had a similar problem here: Since your answer helped me, feel free to answer my question, and I'll accept. – andreas-h Apr 8 '13 at 15:03
Can anyone explain why this works and the original not? – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Jun 17 '14 at 10:33

The issue here is that gvim does spawn a new, dummy terminal for each command and it apparently kills it after the command returns. So the:


returns immediately and apparently(*) the xdg-open internal asynchronous call to X gets terminated, while making the call go to background (as suggested by sappjw) doesn't:

:!xdg-open &

(*) - please correct me if I'm wrong

share|improve this answer
Your theory seems correct, since :!xdg-open; sleep 2 also works. – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Mar 22 at 11:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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