Saturday, June 30, 2012

Re: print vim syntax highlighted text to stdout using ansi color

On Sat, 12 May 2012 20:11:07 -0700 (PDT), Peng Yu wrote:
>
>
> On May 12, 6:47 pm, Magnus Woldrich <m...@japh.se> wrote:
>> On May 12, Peng Yu (Peng Yu) wrote:
>>
>>> I'm wondering if there is a way to print the syntax highlighted text
>>> to stdout using ansi color. I was told the following trick to print
>>> the output to an html file. But I'd prefer the output to stdout.
>>
>> Yes, but let us do better than that and use all the available colors and text
>> attributes, making the output to stdout identical to what you see in your vim
>> session.
>>
>> I have this [0] aliased to cat, and when I don't want the highlighting, I just
>> do a \cat file or =cat file instead.
>>
>> Here's a screenshot of what it looks like:http://devel.japh.se/vim-cat/vim_cat.png
>>
>> [0]:https://github.com/trapd00r/utils/blob/master/v
>
> Would please show me how to use it? The figure is not very clear to
> me.
>
> I tried the following. But nothing happens.
>
> ~/dvcs_src/utils$ ./v v
>

Did you check the content of ./v? Is it the same with
the online version? Did you chmod the script to add the execution bit?

I just tried the latest version and it works for me.
Just note that it has been renamed to `_v`.

HTH

--
alick
Fedora 16 (Verne) user
https://fedoraproject.org/wiki/User:Alick

--
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

No comments: