On Nov 23, 2013 9: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 -'
>
> ~/linux/test/gnu/ack-grep/--color$ cat.sh *.txt
> ==> test1.txt <==
> ABC
>
> ==> test2.txt <==
> AXY
> ~/linux/test/gnu/ack-grep/--color$ printf "%s\n" *.txt|ack --color -x A
> test1.txt
> 1:ABC
>
> test2.txt
> 1:AXY
>
> But when the input is colored,
> ~/linux/test/gnu/ack-grep/--color$ printf "%s\n" *.txt|ack --color -x A|less
>
> I see the following in vim. Does anybody know how to make the correct
> alias of less that it works for both colored cases and uncolored
> cases? Thanks.
>
> 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
There is :AnsiEsc command provided by vimscript #302. It will make this output colored in vim, hiding (assuming vim was compiled with +conceal) or removing this sequences. It will disable other highlighting though if you use any with this buffer.
> --
> 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