On Di, 04 Mai 2010, Benjamin R. Haskell wrote:
> On Tue, 4 May 2010, Ben Fritz wrote:
> > Assuming you're working on a *nix system, I believe you could add '|
> > col -b' to your 'makeprg' or 'shellpipe' options to accomplish option
> > (2).
> >
> > I just recently learned about 'col -b' from a Vim tip about using Vim
> > as a man page viewer. Very useful! Especially if you don't have the
> > conceal patch that Chip mentions.
>
> I don't get it...?
>
> # prints a green 'foo'
> $ echo ${GREEN}foo${NOCOLOR}
> foo
>
> # (myod is like od, but mine)
> $ echo ${GREEN}foo${NOCOLOR} | myod -T
> 00000000 1b 5b 33 32 6d 66 6f 6f 1b 5b 30 6d 0a ».[32mfoo.[0m¬«
>
> # '| col -b' doesn't seem to strip most things out:
> $ echo ${GREEN}foo${NOCOLOR} | col -b
> 32mfoo0m
That's because col filters only reverse line feeds. It filters only some
special ascii chars( ESC, BS among others), that are output by nroff (?)
and does not know about ansi escape sequences.
> Personally, I long-ago wrote a Perl script that handles most of the
> stuff I use.
>
> The gist: perl -lpwe 's/\e\[([\d;]*)m//g'
Nice.
regards,
Christian
--
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