Add wsl support

This commit is contained in:
ec965 2022-10-06 22:15:21 -07:00
parent 14b63af28f
commit 2507c1e2f0

View file

@ -80,22 +80,19 @@ end
-- opens a url in the correct OS
function M.open_url(url)
local os = vim.loop.os_uname().sysname
if os == "Darwin" then
if vim.fn.has("mac") then
io.popen("open " .. url)
return true
end
if os == "Windows" then
elseif vim.fn.has("win64") or vim.fn.has("win32") then
io.popen("start " .. url)
return true
end
if os == "Linux" then
elseif vim.fn.has("wsl") then
io.popen("explorer.exe " .. url)
elseif vim.fn.has("linux") then
io.popen("xdg-open " .. url)
return true
end
return false
end