sponsor Vim development Vim logo Vim Book Ad

intermediate Tip #149: Automatically update your diff upon writing.

 tip karma   Rating 18/9, Viewed by 1092 

created:   October 29, 2001 12:00      complexity:   intermediate
author:   Douglas Potts      as of Vim:   6.0

When trying to reconcile differences between files, and using the new
'diff' functionality in Vim 6.0 you may want to automatically update
the differences as you are working along.  A convienent time is when you
write out either of the files you are diff'ing.  This autocmd will take
care of doing that for you.


" If doing a diff.  Upon writing changes to file, automatically update the
  " differences
  au BufWritePost                  *              if &diff; == 1
  au BufWritePost                  *              :diffupdate
  au BufWritePost                  *              endif

 rate this tip  Life Changing Helpful Unfulfilling 

<<Make great use of those homemade menus | Generating a column of increasing numbers >>

Additional Notes

jaldri1 at gl dot umbc dot edu, June 16, 2003 15:05
Just knowing that :diffupdate exists is useful.  Thanks.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo