Skip to content

Compare with saved file

David-Apps edited this page Sep 28, 2024 · 6 revisions

This simple function compares the current buffer with the saved file. The function puts the result in a new buffer in the current session. Use the ^ or up commands to return to the buffer.

# Compare the current buffer with the saved file.
# usage: <diff
function+diff {
db0
H-
ebvar+

!true ebvar- etmp r+1 W !diff -s - '_; true 1 }