home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / macros / diffwin.vim next >
Encoding:
Text File  |  1999-09-25  |  877 b   |  29 lines  |  [TEXT/VIM!]

  1. " A simple way to create a window which contains the diff of two existing
  2. " windows.  Charles E Campbell, Jr, PhD   <cec@gryphon.gsfc.nasa.gov>
  3. "
  4. " Start Vim with:
  5. "
  6. "    vim -o newfile oldfile
  7. "
  8. " Then load these macros and type
  9. "
  10. "    \df
  11. "
  12. " The resulting three windows will look like this:
  13. "
  14. "    +----+
  15. "    |diff|
  16. "    +----+
  17. "    |new |
  18. "    +----+
  19. "    |old |
  20. "    +----+
  21. "
  22. " You can synchronize the files in the new&old windows to the current
  23. " difference-block being considered.  Just move the cursor in the diff window
  24. " to the difference of interest and hit F8.
  25.  
  26. map \df  <C-W>k<C-W>j:!diff -c <C-R>% <C-R># > /tmp/vimtmp.dif<C-M><C-W>k<C-W>s:e! /tmp/vimtmp.dif<C-M>:!/bin/rm /tmp/vimtmp.dif<C-M><C-M>
  27.  
  28. map <F8> <C-W>k<C-W>k?^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$<CR>jYpdwf,DAGz<C-V><CR><Esc>"aYdd<C-W>j<C-W>j@a<C-W>k<C-W>k?^\*\*\*\*<CR>/^--- <CR>Ypdwf,DAGz<C-V><CR><Esc>"aYdd<C-W>j@a<C-W>kuuz<CR>
  29.