From 511b991e66892b4bb8176ce64c0e8fefb300f638 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sat, 21 Sep 2024 16:23:00 +0100 Subject: feat(fs.lua): add vim.fs.rm() Analogous to the shell `rm` command. --- runtime/doc/lua.txt | 10 ++++++++++ runtime/doc/news.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 1283aac5ca..f3a40cf17a 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -3021,6 +3021,16 @@ vim.fs.parents({start}) *vim.fs.parents()* (`nil`) (`string?`) +vim.fs.rm({path}, {opts}) *vim.fs.rm()* + Remove files or directories + + Parameters: ~ + • {path} (`string`) Path to remove + • {opts} (`table?`) A table with the following fields: + • {recursive}? (`boolean`) Remove directories and their + contents recursively + • {force}? (`boolean`) Ignore nonexistent files and arguments + vim.fs.root({source}, {marker}) *vim.fs.root()* Find the first parent directory containing a specific "marker", relative to a file path or buffer. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index e0e90f78ec..df86cc9244 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -152,7 +152,7 @@ LSP LUA -• TODO +• |vim.fs.rm()| can delete files and directories. OPTIONS -- cgit