On Nov 23, 2013 9:43 PM, "Peng Yu" <pengyu.ut@gmail.com> wrote:
>
> Something like 'grep --color' (although it produces colored output)
> won't cause the problem. You have to use ack. Did you use ack?
It will. Just make sure you use 'grep --color=always'. By default 'grep --color=auto' is used which will not cause problems.
> ~$ ack --version
> ack 2.02
> Running under Perl 5.14.2 at /usr/local/ActivePerl-5.14/bin/perl
>
> Copyright 2005-2013 Andy Lester.
>
> This program is free software. You may modify or distribute it
> under the terms of the Artistic License v2.0.
>
> On Sat, Nov 23, 2013 at 11:29 AM, Gabriele Lana <gabriele.lana@gmail.com> wrote:
> > On Nov 23, 2013, at 6:07 PM, Peng Yu <pengyu.ut@gmail.com> wrote:
> >
> >> Hi
> >>
> >> I have the following alias which works fine when uncolored input.
> >>
> >> ~/linux/test/gnu/ack-grep/--color$ alias less
> >> alias less='vim -R -'
> >>
> >
> >> […]
> >>
> >> 1 ^[[1;32mtest1.txt^[[0m:^[[1;33m1^[[0m:^[[30;43mA^[[0mBC^[[0m^[[K
> >> 2 ^[[1;32mtest2.txt^[[0m:^[[1;33m1^[[0m:^[[30;43mA^[[0mXY^[[0m^[[K
> >
> >
> > I'm unable to reproduce your problem, seems like whenever I pipe something in my shell the ansi escapes are stripped… maybe one of the zsh magic tricks? I don't know
> >
> > Anyway, something like
> >
> > alias less='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | vim -R -'
> >
> > should work (not tested)
> >
> > --
> > Gabriele Lana
> > contact me at gabrielelana at cleancode dot it
> > http://www.cleancode.it - what we do and what we believe in
> > http://www.gabrielelana.it - agile methodologies and programming
> >
> > --
> > --
> > You received this message from the "vim_use" maillist.
> > Do not top-post! Type your reply below the text you are replying to.
> > For more information, visit http://www.vim.org/maillist.php
> >
> > ---
> > You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/Ba1SfjC7J-M/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> Regards,
> Peng
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment