A lot of neovim config updates
This commit is contained in:
parent
d3ab72c6c8
commit
98e8510ae7
21 changed files with 874 additions and 152 deletions
dotfiles/neovim/lua/my/helpers
22
dotfiles/neovim/lua/my/helpers/env.lua
Normal file
22
dotfiles/neovim/lua/my/helpers/env.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
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)
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
local M = {}
|
||||
|
||||
function M.when(f)
|
||||
if vim.g.vscode ~= nil then
|
||||
f()
|
||||
end
|
||||
end
|
||||
|
||||
function M.unless(f)
|
||||
if vim.g.vscode == nil then
|
||||
f()
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue