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.txt26
1 files changed, 14 insertions, 12 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index c5ede97725..4055d93f6a 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2286,11 +2286,12 @@ find({names}, {opts}) *vim.fs.find()*
Parameters: ~
• {names} (string|table|fun(name: string): boolean) Names of the files
and directories to find. Must be base names, paths and globs
- are not supported. If a function it is called per file and
- dir within the traversed directories to test if they match.
+ are not supported. The function is called per file and
+ directory within the traversed directories to test if they
+ match {names}.
• {opts} (table) Optional keyword arguments:
• path (string): Path to begin searching from. If omitted,
- the current working directory is used.
+ the |current-directory| is used.
• upward (boolean, default false): If true, search upward
through parent directories. Otherwise, search through child
directories (recursively).
@@ -2298,13 +2299,14 @@ find({names}, {opts}) *vim.fs.find()*
reached. The directory itself is not searched.
• type (string): Find only files ("file") or directories
("directory"). If omitted, both files and directories that
- match {name} are included.
+ match {names} are included.
• limit (number, default 1): Stop the search after finding
this many matches. Use `math.huge` to place no limit on the
number of matches.
Return: ~
- (table) The paths of all matching files or directories
+ (table) The normalized paths |vim.fs.normalize()| of all matching
+ files or directories
normalize({path}) *vim.fs.normalize()*
Normalize a path to a standard format. A tilde (~) character at the
@@ -2312,16 +2314,16 @@ normalize({path}) *vim.fs.normalize()*
backslash (\) characters are converted to forward slashes (/). Environment
variables are also expanded.
- Example: >
+ Examples: >
- vim.fs.normalize('C:\Users\jdoe')
- => 'C:/Users/jdoe'
+ vim.fs.normalize('C:\Users\jdoe')
+ => 'C:/Users/jdoe'
- vim.fs.normalize('~/src/neovim')
- => '/home/jdoe/src/neovim'
+ vim.fs.normalize('~/src/neovim')
+ => '/home/jdoe/src/neovim'
- vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
- => '/Users/jdoe/.config/nvim/init.vim'
+ vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
+ => '/Users/jdoe/.config/nvim/init.vim'
<
Parameters: ~