mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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*
|
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()*
|
vim.fs.basename({file}) *vim.fs.basename()*
|
||||||
Return the basename of the given path
|
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 uv = vim.uv
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user