aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt27
1 files changed, 26 insertions, 1 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index ba59c67446..8a14f80856 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2166,7 +2166,8 @@ dir({path}) *vim.fs.dir()*
Parameters: ~
{path} (string) An absolute or relative path to the
- directory to iterate over
+ directory to iterate over. The path is first
+ normalized |vim.fs.normalize()|.
Return: ~
Iterator over files and directories in {path}. Each
@@ -2223,6 +2224,30 @@ find({names}, {opts}) *vim.fs.find()*
Return: ~
(table) The paths of all matching files or directories
+normalize({path}) *vim.fs.normalize()*
+ Normalize a path to a standard format. A tilde (~) character
+ at the beginning of the path is expanded to the user's home
+ directory and any backslash (\) characters are converted to
+ forward slashes (/). Environment variables are also expanded.
+
+ Example: >
+
+ vim.fs.normalize('C:\Users\jdoe')
+ => 'C:/Users/jdoe'
+
+ vim.fs.normalize('~/src/neovim')
+ => '/home/jdoe/src/neovim'
+
+ vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
+ => '/Users/jdoe/.config/nvim/init.vim'
+<
+
+ Parameters: ~
+ {path} (string) Path to normalize
+
+ Return: ~
+ (string) Normalized path
+
parents({start}) *vim.fs.parents()*
Iterate over all the parents of the given file or directory.