diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index cd263948..dc89b750 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -109,7 +109,7 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { if event.match:match("^%w%w+://") then return end - local file = vim.loop.fs_realpath(event.match) or event.match + local file = vim.uv.fs_realpath(event.match) or event.match vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") end, }) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index a2ba5e35..805be479 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -18,7 +18,7 @@ return { { "fE", function() - require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) + require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() }) end, desc = "Explorer NeoTree (cwd)", }, @@ -44,7 +44,7 @@ return { end, init = function() if vim.fn.argc(-1) == 1 then - local stat = vim.loop.fs_stat(vim.fn.argv(0)) + local stat = vim.uv.fs_stat(vim.fn.argv(0)) if stat and stat.type == "directory" then require("neo-tree") end @@ -151,7 +151,7 @@ return { { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, + { "fR", Util.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, -- git { "gc", "Telescope git_commits", desc = "commits" }, { "gs", "Telescope git_status", desc = "status" }, diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 9f359b7b..1d6dd560 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -23,7 +23,7 @@ return { { "fM", function() - require("mini.files").open(vim.loop.cwd(), true) + require("mini.files").open(vim.uv.cwd(), true) end, desc = "Open mini.files (cwd)", }, diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 4fec1425..5554b6af 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -109,7 +109,7 @@ return { -- stylua: ignore keys = { { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, - { "tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, + { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index fabeec2c..8ba24b51 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -3,7 +3,7 @@ local xdg_config = vim.env.XDG_CONFIG_HOME or vim.env.HOME .. "/.config" ---@param path string local function have(path) - return vim.loop.fs_stat(xdg_config .. "/" .. path) ~= nil + return vim.uv.fs_stat(xdg_config .. "/" .. path) ~= nil end return { diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index 2d2527c1..b9b83165 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -42,7 +42,7 @@ return { lint.linters_by_ft = opts.linters_by_ft function M.debounce(ms, fn) - local timer = vim.loop.new_timer() + local timer = vim.uv.new_timer() return function(...) local argv = { ... } timer:start(ms, 0, function() diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 24fd0a1b..54c8706c 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -50,7 +50,7 @@ setmetatable(M, { }) function M.is_win() - return vim.loop.os_uname().sysname:find("Windows") ~= nil + return vim.uv.os_uname().sysname:find("Windows") ~= nil end ---@param plugin string @@ -97,8 +97,8 @@ function M.lazy_notify() local orig = vim.notify vim.notify = temp - local timer = vim.loop.new_timer() - local check = assert(vim.loop.new_check()) + local timer = vim.uv.new_timer() + local check = assert(vim.uv.new_check()) local replay = function() timer:stop() diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index 4c212470..ae71e67c 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -5,7 +5,7 @@ local Util = require("lazyvim.util") local M = {} function M.hash(file) - local stat = vim.loop.fs_stat(file) + local stat = vim.uv.fs_stat(file) if not stat then return end diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index ea0ba3be..e4bdeab1 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -22,7 +22,7 @@ M.spec = { "lsp", { ".git", "lua" }, "cwd" } M.detectors = {} function M.detectors.cwd() - return { vim.loop.cwd() } + return { vim.uv.cwd() } end function M.detectors.lsp(buf) @@ -48,7 +48,7 @@ end ---@param patterns string[]|string function M.detectors.pattern(buf, patterns) patterns = type(patterns) == "string" and { patterns } or patterns - local path = M.bufpath(buf) or vim.loop.cwd() + local path = M.bufpath(buf) or vim.uv.cwd() local pattern = vim.fs.find(patterns, { path = path, upward = true })[1] return pattern and { vim.fs.dirname(pattern) } or {} end @@ -58,14 +58,14 @@ function M.bufpath(buf) end function M.cwd() - return M.realpath(vim.loop.cwd()) or "" + return M.realpath(vim.uv.cwd()) or "" end function M.realpath(path) if path == "" or path == nil then return nil end - path = vim.loop.fs_realpath(path) or path + path = vim.uv.fs_realpath(path) or path return Util.norm(path) end @@ -133,7 +133,7 @@ function M.info() lines[#lines + 1] = "vim.g.root_spec = " .. vim.inspect(spec) lines[#lines + 1] = "```" require("lazyvim.util").info(lines, { title = "LazyVim Roots" }) - return roots[1] and roots[1].paths[1] or vim.loop.cwd() + return roots[1] and roots[1].paths[1] or vim.uv.cwd() end ---@type table @@ -164,7 +164,7 @@ function M.get(opts) local ret = M.cache[buf] if not ret then local roots = M.detect({ all = false }) - ret = roots[1] and roots[1].paths[1] or vim.loop.cwd() + ret = roots[1] and roots[1].paths[1] or vim.uv.cwd() M.cache[buf] = ret end if opts and opts.normalize then diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 478876f5..86dc02f0 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -25,9 +25,9 @@ function M.telescope(builtin, opts) opts = vim.tbl_deep_extend("force", { cwd = Util.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] if builtin == "files" then if - vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") - and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.ignore") - and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.rgignore") + vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.git") + and not vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.ignore") + and not vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.rgignore") then if opts.show_untracked == nil then opts.show_untracked = true @@ -37,7 +37,7 @@ function M.telescope(builtin, opts) builtin = "find_files" end end - if opts.cwd and opts.cwd ~= vim.loop.cwd() then + if opts.cwd and opts.cwd ~= vim.uv.cwd() then local function open_cwd_dir() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 6eaefdb3..1de0730b 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -150,7 +150,7 @@ function M.fg(name) end M.skip_foldexpr = {} ---@type table -local skip_check = assert(vim.loop.new_check()) +local skip_check = assert(vim.uv.new_check()) function M.foldexpr() local buf = vim.api.nvim_get_current_buf()