Sunday, July 1, 2012

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

On Sun, Jul 1, 2012 at 11:14 AM, Magnus Woldrich <m@japh.se> wrote:
>> MacOS X (unix) version
>> Compiled by root@peng-yus-macbook-pro.local
>
>
> I'm sorry but the only thing I know about terminals in macos is that
> they doesn't work.
>
> Can you try it in something that is not terminal.app or iterm? Something
> like an xterm.

_v with xterm doesn't work on my mac. But _v does work on my linux machine.

I'm trying to understand _v better. Why fd 9 is used? Is it special to vim?

exec 9<>"$tmpfile"

It seems the vim command in _v writes to fd 9.

When I try the following command, it indeed write the content of _v
along with the ansi color code to output.txt

/usr/bin/vim -e -X -R "_v" -c "source _v" -c "visual" -c "bufdo call
AnsiHighlight()" -c qa 2>/dev/null 9>output.txt

But the above code does not work on Mac. I tried with a number of file
descriptors. But none of them work. So it seems the problem is to find
a fd that works on Mac.

Note that this seem to be related to my recent question.

http://groups.google.com/group/vim_use/browse_thread/thread/5797aa7de679930

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

No comments:

Post a Comment