1
Fork 0
satellite/dotfiles/neovim/lua/my/helpers/env.lua

24 lines
428 B
Lua
Raw Normal View History

2022-10-09 03:28:51 +02:00
local function makeEnv(cond)
return {
active = cond,
unless = function(f)
2022-12-05 01:18:31 +01:00
if not cond() then f() end
2022-10-09 03:28:51 +02:00
end,
when = function(f)
2022-12-05 01:18:31 +01:00
if cond() then f() end
2022-10-09 03:28:51 +02:00
end
}
end
return {
vscode = makeEnv(function()
return vim.g.vscode ~= nil
end),
2022-12-05 01:18:31 +01:00
neovide = makeEnv(function()
return vim.g.neovide ~= nil
end),
2022-10-09 03:28:51 +02:00
firevim = makeEnv(function()
return vim.g.started_by_firenvim ~= nil
end)
}