Commits

David Wolever committed d3934be

Adding a function to vimrc making it easier to review diffs.

  • Participants
  • Parent commits 423c5a2

Comments (0)

Files changed (1)

 " Make 'grep' ignore '.svn' directories and recurse
 set grepprg=grep\ -R\ --exclude='*.svn*'
 
+" Fix a diff, making it easier to review.
+" Add a blank line before each '@@ ... hunk line info ...@@' and each 'diff',
+" making it easier to jump around using { and }
+fun! ReviewDiff()
+    let oldreg_val = getreg('d')
+    let oldreg_type = getregtype('d')
+    call setreg('d', '', 'V')
+    g/^diff/put! d
+    g/^@@/put! d
+    call setreg('d', oldreg_val, oldreg_type)
+endfun
+
 " Enable perdy 256 color mode
 " set t_Co=256