(nvim) nvim v0.12 migration
This commit is contained in:
parent
f0db0ada98
commit
7b2eb8c525
51 changed files with 1629 additions and 1627 deletions
|
|
@ -1,37 +0,0 @@
|
|||
---@class juancwu.utils.os
|
||||
local M = {}
|
||||
|
||||
---@return boolean
|
||||
function M.is_linux()
|
||||
return vim.loop.os_uname().sysname:find("Linux") ~= nil
|
||||
end
|
||||
|
||||
---@return boolean
|
||||
function M.is_mac()
|
||||
return vim.loop.os_uname().sysname:find("Darwin") ~= nil
|
||||
end
|
||||
|
||||
---@return boolean
|
||||
function M.is_win()
|
||||
return vim.loop.os_uname().sysname:find("Windows") ~= nil
|
||||
end
|
||||
|
||||
---@return boolean
|
||||
function M.is_wsl()
|
||||
return vim.fn.has("wsl") == 1
|
||||
end
|
||||
|
||||
---@param cmd string
|
||||
---@return boolean
|
||||
function M.cmd_exists(cmd)
|
||||
local handle = io.popen("command -v " .. cmd)
|
||||
if handle ~= nil then
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
return #result > 0
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue