Use Watch Mode in diffnav
mainWatch mode periodically re-runs a specified command and refreshes the display, which is useful for monitoring changes in real-time.
- Watch unstaged changes: By default, this runs
git diffevery 2 seconds. - Watch staged changes: Use
--watch-cmdto specify the command and--watch-intervalto set the frequency. - Watch against a branch: Use
--watch-cmdto specify a diff against a specific branch.
# watch unstaged changes (default: git diff, every 2s)
diffnav --watch
# watch staged changes with a custom interval
diffnav --watch-cmd "git diff --cached" --watch-interval 5s
# watch changes against a specific branch
diffnav --watch-cmd "git diff main..."