From 62b07ccb81e960dc8e9a05c8e6d9a0b5e13ce5e7 Mon Sep 17 00:00:00 2001 From: Feng Hao Date: Fri, 7 Mar 2014 21:55:36 +0800 Subject: [PATCH 1/2] Update txtbrowser.vim fixed xdg-open doesn't work inside gvim --- plugin/txtbrowser.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/txtbrowser.vim b/plugin/txtbrowser.vim index 31f4a70..06ccd83 100644 --- a/plugin/txtbrowser.vim +++ b/plugin/txtbrowser.vim @@ -290,7 +290,7 @@ function! s:TxtbrowserOpenUrl (url) exec ':silent !cmd /q /c start "\""dummy title"\"" ' . "\"" . a:url . "\"" elseif (has("unix")) "exec ':silent !firefox ' . "\"" . a:url . "\" & " - exec ":silent !xdg-open \"" . a:url . "\"" + exec ":silent !xdg-open \"" . a:url . "\" &" endif endif exec ":redraw!" From 27f9c841a0ea6a59837842ed47db7ea3f256dc2f Mon Sep 17 00:00:00 2001 From: Feng Hao Date: Tue, 11 Mar 2014 15:49:27 +0800 Subject: [PATCH 2/2] Update txtbrowser.vim eidt function s:TxtbrowserOpenUrl(url). It can work better on different platform --- plugin/txtbrowser.vim | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/plugin/txtbrowser.vim b/plugin/txtbrowser.vim index 06ccd83..326388f 100644 --- a/plugin/txtbrowser.vim +++ b/plugin/txtbrowser.vim @@ -282,16 +282,23 @@ function! s:TxtbrowserOpenUrl (url) endif if exists("g:default_web_browser") - exec ":silent ! " . g:default_web_browser . " \"" . a:url . "\" &" + if (has("mac")) + exec "!g:default_web_browser \"" . a:url . "\"" + elseif (has("win32") || has("win32unix")) + exec ":silent !start " . g:default_web_browser . " \"" . a:url . "\"" + elseif (has("unix")) + exec ":silent !" . g:default_web_browser . " \"" . a:url . "\" &" + endif else - if (has("mac")) - exec "!open \"" . a:url . "\"" - elseif (has("win32") || has("win32unix")) - exec ':silent !cmd /q /c start "\""dummy title"\"" ' . "\"" . a:url . "\"" - elseif (has("unix")) - "exec ':silent !firefox ' . "\"" . a:url . "\" & " - exec ":silent !xdg-open \"" . a:url . "\" &" - endif + if (has("mac")) + exec "!open \"" . a:url . "\"" + elseif (has("win32") || has("win32unix")) + exec ':silent !cmd /q /c start "\""dummy title"\"" ' . "\"" . a:url . "\"" + let g:test=':silent !cmd /q /c start "\""dummy title"\"" ' . "\"" . a:url . "\"" + elseif (has("unix")) + "exec ':silent !firefox ' . "\"" . a:url . "\" & " + exec ":silent !xdg-open \"" . a:url . "\" &" + endif endif exec ":redraw!" endfunction