For config with true as the default value, using or is not the right solution since false or true is true, which means even if the user sets the config to false, the config still run as true.
vim.F.if_nil under the hood compares its value to nil
function if_nil(a, b)
if a == nil then
return b
end
return a
end
See https://github.com/NTBBloodbath/doom-one.nvim/issues/32#issuecomment-1315344450
For config with
true
as the default value, usingor
is not the right solution sincefalse or true
istrue
, which means even if the user sets the config tofalse
, the config still run astrue
.vim.F.if_nil
under the hood compares its value tonil