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

23 lines
369 B
Lua
Raw Normal View History

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