From 45809040d2134c56e8216c6cb83bbe9373840bd1 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Fri, 21 Jun 2019 14:55:49 +0300 Subject: [PATCH] [nvim] add an optional argument for the Open command --- nvim/lib/files.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvim/lib/files.vim b/nvim/lib/files.vim index 25cc782..a37be01 100644 --- a/nvim/lib/files.vim +++ b/nvim/lib/files.vim @@ -76,7 +76,7 @@ nnoremap &buftype is# '' ? ":write\" : "\" " }}} " Open {{{ - " opens file with a system program + " opens file or URL with a system program function s:Open(path) " HACK: 2nd parameter of this function is called 'remote', it tells " whether to open a remote (1) or local (0) file. However, it doesn't work @@ -88,7 +88,7 @@ nnoremap &buftype is# '' ? ":write\" : "\" " if-statement which contains the 'gf' command. call netrw#BrowseX(a:path, 2) endfunction - command Open call s:Open(expand('%')) + command -nargs=* -complete=file Open call s:Open(empty() ? expand('%') : ) " }}} " }}}