aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-08-13 23:27:17 +0800
committerjdhao <jdhao@hotmail.com>2021-08-13 23:27:17 +0800
commitfa203cf3b86f82f6368c117dd1cff45896b633a9 (patch)
tree9ecc60fb28d4ea66fd08947d6d517d53d43efa40 /autoload
parentf9feafa5bbbc38ec883b4753e836521aa04c23b7 (diff)
feat: make :edit command supports file glob patterns
Diffstat (limited to 'autoload')
-rw-r--r--autoload/utils.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/autoload/utils.vim b/autoload/utils.vim
index 4077be2..d1a4a47 100644
--- a/autoload/utils.vim
+++ b/autoload/utils.vim
@@ -176,3 +176,12 @@ function! utils#CaptureCommandOutput(command) abort
execute a:command
redir END
endfunction
+
+" Edit all files matching the given patterns.
+function! utils#MultiEdit(patterns) abort
+ for p in a:patterns
+ for f in glob(p, 0, 1)
+ execute 'edit ' . f
+ endfor
+ endfor
+endfunction