the_silver_searcher
the_silver_searcher copied to clipboard
Truncate matching line for compressed/obfuscated single line files
For a web application, its normal to contain compressed js/css files that just have a single long line. For long lines, Is it possible to ask SS to only show the match and X chars before and after the match ?
I could use that feature as well, when ag finds a match the entire file (because it's a one-liner) is printed.
I would love this as well. Using ag with vim, those minimized js/css files are annoying. If someone has a solution I would be interested!
Yes, please add a flag to truncate the lines. As a hopefully short term fix in Vim, I wrote a python script that ag can be piped into: https://gist.github.com/tweekmonster/86f043a07d68eaa062de
Definitely would be appreciated. Experienced this today (also happened to be my first test with ag :p) and was a tad overwhelming with minified files (was searching a directory of Lua). Thought I'd capture a GIF showing the first three files and a handful of matches (kept going so I had to trim it).