From 90711bb3cbcb38546d8d9ca8a2b9a870e7bd78c4 Mon Sep 17 00:00:00 2001 From: Sidney Liebrand Date: Tue, 25 Aug 2020 02:42:52 +0200 Subject: [PATCH] #116 try an alternative method of opening links with mkdx#gf --- autoload/mkdx.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/mkdx.vim b/autoload/mkdx.vim index 881b244..edf1593 100644 --- a/autoload/mkdx.vim +++ b/autoload/mkdx.vim @@ -2079,7 +2079,8 @@ fun! mkdx#gf(...) let is_img = match(get(split(destination, '\.'), -1, ''), g:mkdx#settings.image_extension_pattern) > -1 if !do_int && (do_ext || destination =~? '^http' || is_img) - silent! call system('open ' . destination) + let cmd = executable('open') ? 'open' : (executable('xdg-open') ? 'xdg-open' : '') + silent! exec '!' . cmd . ' ' . destination else if get(s:util.hlAtCursor(), 0, '') ==? 'mkdxLink' normal! gf