6

I am using gvim 7.3.401 on archlinux. The shell command :!xdg-open http://www.vim.org 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?

Jeremy W
  • 3,659
Maxim Kim
  • 163

2 Answers2

9

Try :!xdg-open http://www.vim.org &

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

sappjw
  • 233
2

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:

:!xdg-open http://www.vim.org

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 http://www.vim.org &

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

derenio
  • 121