git.fiddlerwoaroof.com
fmt_grep
9b88566c
 #!/bin/zsh
edcae078
 egrep --color='yes' -r $*  | python -c "
9b88566c
 import sys,itertools
 for line in sys.stdin:
   try:
      file, text = line.split(':',1)
   except ValueError:
      file, text = line.split('-',1)
 
   text = text.split()
   texti = iter(text)
   text = [list(v1 for __,v1 in v) for __,v in itertools.groupby(enumerate(text), lambda x: x[0]/20)]
edcae078
   if text:
      print '%s\t\t%s' % (file, ' '.join(text[0]))
9b88566c
   for line in text[1:]:
     print '\t\t%s' % ' '.join(line)
 "