What
options.lua:70 sets:
autoread tells Neovim to reload a file when it detects the file has changed on disk, but only at the moment Neovim itself checks for changes — which requires an explicit :checktime call. Without a trigger, autoread has no practical effect when switching back from another terminal, running git pull, or letting an external tool regenerate a file.
Where
lua/config/options.lua:70
Why it matters
The option creates a false expectation: the setting is present and looks like auto-reload is active, but files only reload if the user manually runs :checktime. This is a well-known autoread gotcha.
Recommended action
Add an autocmd to call :checktime at the moments when an external change is most likely to be relevant:
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter" }, {
callback = function()
if vim.fn.getcmdwintype() == "" then
vim.cmd("checktime")
end
end,
})
The getcmdwintype() guard prevents :checktime from firing inside the command window (which can cause errors). FocusGained covers switching back from another app; BufEnter covers :e / buffer switch. Both are standard pairings for autoread in the Neovim ecosystem.
What
options.lua:70sets:autoreadtells Neovim to reload a file when it detects the file has changed on disk, but only at the moment Neovim itself checks for changes — which requires an explicit:checktimecall. Without a trigger,autoreadhas no practical effect when switching back from another terminal, runninggit pull, or letting an external tool regenerate a file.Where
lua/config/options.lua:70Why it matters
The option creates a false expectation: the setting is present and looks like auto-reload is active, but files only reload if the user manually runs
:checktime. This is a well-knownautoreadgotcha.Recommended action
Add an autocmd to call
:checktimeat the moments when an external change is most likely to be relevant:The
getcmdwintype()guard prevents:checktimefrom firing inside the command window (which can cause errors).FocusGainedcovers switching back from another app;BufEntercovers:e/ buffer switch. Both are standard pairings forautoreadin the Neovim ecosystem.