-- exrc does not work when using -u. Also, unlike exrc, we only evaluate -- .nvim.lua and only the one in the project root. local dirs = vim.fs.find({ '.git' }, { type = 'directory', upward = true, stop = vim.env.HOME, }) if #dirs == 1 then local file = vim.fs.joinpath(vim.fs.dirname(dirs[1]), '.nvim.lua') local stat = vim.uv.fs_stat(file) if stat and stat.type == 'file' then local trusted = vim.secure.read(file) if trusted then assert(loadstring(trusted, '@' .. file))() end end end -- automatically trust configs we save vim.api.nvim_create_autocmd('BufWritePost', { pattern = '.nvim.lua', command = 'trust', })