[PLUGIN] Lessdiff -> colourised diffs via less

Wouter van Heyst larstiq at larstiq.dyndns.org
Fri Dec 9 22:19:32 GMT 2005


On Fri, Dec 09, 2005 at 04:00:59PM -0600, Michael Ellerman wrote:
> Hiya,
> 
> I've gone mental with this bzr command + less thing.
> 
> I've just implemented lessdiff, it runs diff via less, which is not that 
> exciting. BUT, if you have colordiff installed you'll get coloured diffs - 
> super cool.

And a small hack on that to run it through 'vim -c "set syntax=diff" -'
instead of PAGER. Next, trying to figure out why vim doesn't recognise
bzr diff output currently.

Wouter van Heyst
-------------- next part --------------
=== modified file '__init__.py'
--- __init__.py	
+++ __init__.py	
@@ -38,7 +38,6 @@
             return
 
         pipe1.consumer()
-        pager = os.environ.get('PAGER', 'less')
-        os.execvp(pager, [pager, '-R', '-'])
+        os.execvp('vim', ['vim', '-c', 'set syntax=diff', '-'])
 
 bzrlib.commands.register_command(cmd_lessdiff)



More information about the bazaar mailing list