From e80379a2e5f10f28e9645ff457c288b6ded694f7 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sat, 9 Nov 2019 23:02:18 +0200 Subject: [PATCH] [nvim] add EditGlob function --- nvim/lib/files.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nvim/lib/files.vim b/nvim/lib/files.vim index 5b62535..dc66d1b 100644 --- a/nvim/lib/files.vim +++ b/nvim/lib/files.vim @@ -91,6 +91,20 @@ nnoremap &buftype is# '' ? ":writewall\" : "\" command -nargs=* -complete=file Open call s:Open(empty() ? expand('%') : ) " }}} + " EditGlob {{{ + " Yes, I know about the existence of :args, however it modifies the + " argument list, so it doesn't play well with Obsession.vim because it + " saves the argument list in the session file. + function s:EditGlob(...) + for l:glob in a:000 + for l:name in glob(l:glob, 0, 1) + execute 'edit' fnameescape(l:name) + endfor + endfor + endfunction + command -nargs=* -complete=file -bar EditGlob call s:EditGlob() + " }}} + " }}}