rking / ag.vim

Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
1.74k stars 131 forks source link

Allow using a `g:ag_max_line_len` option to truncate long lines #122

Closed nikvdp closed 7 years ago

nikvdp commented 9 years ago

Internally uses cut command as the pager when calling ag to stop long lines from ending up in your quickfix.

Usage: In .vimrc

let g:ag_max_line_len = 200
losingkeys commented 9 years ago

Rather than trimming the results, why not use something like this?

autocmd FileType qf setlocal nowrap
nikvdp commented 8 years ago

Didn't know about that! Still doesn't quite do the trick if the lines are ridiculously long though (e.g. minified css/js files): (this image is from after adding the autocmd line to my vimrc)

tplunket commented 8 years ago

As of commit ggreer/the_silver_searcher@9e11263acf0fdf90fdcac3d028f4ba8376601031 (25 November 2015), ag supports the -W option to limit the length of outputted lines.