Is there a way to save the changes I made to my vim buffer as a patch file for the original file, without saving it as a separate file and using diff?
You could also filter the buffer through
diff using the
:%! diff -au "%" -
This will fill the buffer with the diff, rather than writing it to disk; you may want to set
readonly so you don't clobber the original by accident (OTOH, that shouldn't be a serious problem because you have the file under version control, right?). Of course, it helps to have the inverse command:
:%! patch -o - "%"
That transforms your diff back into the modified file.