sponsor Vim development Vim logo Vim Book Ad

GoDiff : Quick Inline Colored Diff

 script karma  Rating 42/12, Downloaded by 1328  Comments, bugs, improvements  Vim wiki

created by
Rolf Asmund
script type
A plug-in to quickly compare two sections of text with colors.

checkout the wiki here with screenshots:


First copy text-1 (e.g. '3yy' to copy 3 lines)
Then, either
  visually select text-2 (e.g. 'V2j' to visually select 3 lines)
  Now press 'gd' to compare text-1 and text-2
  give a count for number of lines to diff followed by gd (e.g. '3gd')
Finally press 'gd' again to restore colors
Registers can also be used. Try '"a3yy' or '3"ayy' to copy 3 lines to register 'a'
Then '"a3gd' or '3"agd' on text to compare with.
For single line compare, simply press 'yy' on text-1 and 'gd' on text-2
install details
   Source this file
   Copy its content into your .vimrc
   If using pathogen, copy this file into .vim/bundle/godiff/plugin/
   Copy it to your .vim/plugin directory to automatically source it when vim
   Copy it to your .vim/plugins directory (or any other directory) and source
   it explicitly from your .vimrc

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
godiff.vim 1.2 2016-04-05 7.0 Rolf Asmund Support for v:count and v:register
godiff.vim 1.1 2016-03-21 7.0 Rolf Asmund Support for guifg/bg (for gvim)
Disable hlsearch and spell while active
If no selection, do single-line diff
godiff.vim 1.0 2016-03-19 7.0 Rolf Asmund Initial upload
ip used for rating:

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 the maillist. Help Bram help Uganda.
Vim at Github