From 2a62bec37ced51678ff914700d7165605d5a0d53 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Sun, 15 May 2022 20:10:12 -0600 Subject: feat(fs): add vim.fs.dir() This function is modeled after the path.dir() function from Penlight and the luafilesystem module. --- runtime/doc/lua.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index bf30700fc0..5274b829b5 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2160,6 +2160,20 @@ basename({file}) *vim.fs.basename()* Return: ~ (string) Basename of {file} +dir({path}) *vim.fs.dir()* + Return an iterator over the files and directories located in + {path} + + Parameters: ~ + {path} (string) An absolute or relative path to the + directory to iterate over + + Return: ~ + Iterator over files and directories in {path}. Each + iteration yields two values: name and type. Each "name" is + the basename of the file or directory relative to {path}. + Type is one of "file" or "directory". + dirname({file}) *vim.fs.dirname()* Return the parent directory of the given file or directory -- cgit