Files
Miguel Palhas 020bf7716e fix(config): cleanup bugs, redundancy, and add agent-friendly auto-reload
- remove broken mini.files mappings (plugin disabled; yazi is used now)
- dedupe tint.nvim spec (drop plugins/theme.lua, keep ui.lua)
- drop dead copilot cmp source + moot Supermaven symbol (Supermaven stays inline)
- remove yaml from biome formatters (biome has no yaml support)
- collapse 3x biome chain to a single biome-check pass
- remove duplicate insert-mode jk mapping
- lazy-load tailwind-tools by filetype
- diagnostics: update_in_insert = false
- untrack .nvimlog, add .gitignore
- auto-reload files changed on disk (autoread + checktime autocmds)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 14:12:45 +01:00

23 lines
905 B
Lua

-- Reload buffers when their file changes on disk (e.g. edited by a coding agent).
-- `autoread` (set in options.lua) only takes effect when something triggers a check,
-- so we run `checktime` on focus/movement/buffer events. Event-based only: no idle
-- polling, so there's zero overhead when nvim is sitting still.
local grp = vim.api.nvim_create_augroup("auto_reload", { clear = true })
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI", "TermClose", "TermLeave" }, {
group = grp,
callback = function()
-- skip while typing a command or in the command-line window
if vim.fn.mode() ~= "c" and vim.fn.getcmdwintype() == "" then
vim.cmd "silent! checktime"
end
end,
})
vim.api.nvim_create_autocmd("FileChangedShellPost", {
group = grp,
callback = function()
vim.notify("File reloaded (changed on disk)", vim.log.levels.INFO)
end,
})