mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
use lua for may_create_dir
This commit is contained in:
@@ -14,4 +14,14 @@ function M.executable(name)
|
||||
return false
|
||||
end
|
||||
|
||||
function M.may_create_dir()
|
||||
local fpath = vim.fn.expand('<afile>')
|
||||
local parent_dir = vim.fn.fnamemodify(fpath, ":p:h")
|
||||
local res = vim.fn.isdirectory(parent_dir)
|
||||
|
||||
if res == 0 then
|
||||
vim.fn.mkdir(parent_dir, 'p')
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user