mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
docs: add tag vim.fs.exists()
and document suggested replacement
This commit is contained in:
parent
203e7a43d1
commit
76dcc7029b
@ -2926,6 +2926,17 @@ vim.keymap.set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()*
|
||||
==============================================================================
|
||||
Lua module: vim.fs *vim.fs*
|
||||
|
||||
|
||||
*vim.fs.exists()*
|
||||
Use |uv.fs_stat()| to check a file's type, and whether it exists.
|
||||
|
||||
Example: >lua
|
||||
if vim.uv.fs_stat(file) then
|
||||
vim.print("file exists")
|
||||
end
|
||||
<
|
||||
|
||||
|
||||
vim.fs.basename({file}) *vim.fs.basename()*
|
||||
Return the basename of the given path
|
||||
|
||||
|
@ -1,3 +1,15 @@
|
||||
--- @brief <pre>help
|
||||
--- *vim.fs.exists()*
|
||||
--- Use |uv.fs_stat()| to check a file's type, and whether it exists.
|
||||
---
|
||||
--- Example:
|
||||
---
|
||||
--- >lua
|
||||
--- if vim.uv.fs_stat(file) then
|
||||
--- vim.print("file exists")
|
||||
--- end
|
||||
--- <
|
||||
|
||||
local uv = vim.uv
|
||||
|
||||
local M = {}
|
||||
|
Loading…
Reference in New Issue
Block a user