Take the 2-minute tour ×  Is there a way to limit the length of
the line matched by ack? If ack matches, for example, a minified
javascript file, the line it prints out can be very large. I
still want it to show the highlighted match, but ideally with
the line cut before and after the match with elipses: "... stuff
match stuff ...". Not seeing anything conclusive in the ack
docs.  I tried digging into it with something like  ack pattern
| awk '{print substr($0,1,200) }'  but awk seems to be stripping
coloring and formatting, which is undesired. Also I tried (bear
with me for a second):  ack pattern | ack pattern  To see if I
could re-ack on each line and chop it up or something, but that
has the same formatting problem. Piping ack output removes the
line breaks apparently?  Edited based on comment:  Maybe it will
help to explain the main reason why I want this. I use ack.vim
to search in my project. I often want to ack through my
javascript files to find a word, like "cookie". We have jQuery
and other minifie