greyblake / vim-preview

Vim plugin for previewing markup files(markdown,rdoc,textile,html)
GNU General Public License v2.0
209 stars 29 forks source link

Use xdg-open for Linux #34

Open darvelo opened 10 years ago

darvelo commented 10 years ago

For some crazy reason, when running this plugin with the default hotkey I get this message in GNOME:

Iceweasel is already running, but is not responding.

I get this error sometimes with other things, and according to a poster on the Debian forums:

This bug is, IMO, the single worst/most pernicious bug in the entire Linux world. But it's clearly not going to be fixed. Which sucks.

For this reason I choose to use xdg-open from terminal to open urls. It chooses the system- or user-configured default browser, just like open on Mac.

If I manually do:

 let g:PreviewBrowsers = "xdg-open"

Then it works like a charm. But maybe this could do better with official support? I dunno. In any case, it may help people who have the same mysterious error.

greyblake commented 10 years ago

We already use open as default for Mac. It's possible to make the same with xdg-open for linux. Don't you know do other Linux distros use xdg-open? (like Red Hat for example)

darvelo commented 10 years ago

xdg-open is part of a standard developed in part by Red Hat as part of the freedesktop.org project. The first official version of xdg-utils was released in 2006, and is in common use. Here's the Arch linux article for xdg-open. I haven't personally used any Linux besides Debian, but I know xdg-open is at least available on Debian, Ubuntu, Arch, and Fedora. On Debian it was installed by default.

Valloric commented 9 years ago

Another vote for xdg-open usage; my default browser on Ubuntu is Chrome, but this plugin starts Firefox.