On 16/04/10 18:59, [email protected] wrote:

Hi,

no,no,no...I LIKE context sensitive highlightning in vim! :)

But:
Some tools, which normally are made fpr output directly to
the console use ESC-sequences to color parts of the text.
From time to time I use the tool 'script' to log all of
the text into a file to review it later (I cannot read
at the speed these are spitting out dozens of words... ;)

I like to use vim for that ... but these [XXX] escape
sequences makes reading the output a very diffcult task, since they
are not interpreted by vim.

Piping the output through col -b remove a part of those but
by far not all.

Is there any way to get back my love "pure ascii" ???

Best regards and have a nice weekend!
mcc



col -b should remove a lot of escape / backspace sequences. I'm not sure which ones it misses, but if you can identify them, it should be easy to define a :s[ubstitute] command to filter them out. Or else, even without col -b, this sounds like a typical job for a Vim version compiled with Vince Negri's conceal patch (No. 14 at http://groups.google.com/group/vim_dev/web/vim-patches ), and maybe some appropriate syntax script to display the colours but not the control sequences.

Example: remove Esc then [ then any number of semicolon-separated decimal numbers then one letter, or Esc then one character which is not a left bracket (untested):

        :%s/\e\%(\%([[]\%(\d\+;\)*\d\+\a\)\|[^[]\)//g

See ":help pattern-overview" and what follows.


Best regards,
Tony.
--
All this wheeling and dealing around, why, it isn't for money, it's for
fun.  Money's just the way we keep score.

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

Reply via email to