Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have quite a lot of Perl scripts which print colored output to the terminal, using Term::ANSIColor. This is the same as when a shell script does e.g.

echo -e '\e[1;31mError:\e[0m Your fault.'

Viewing log files of these commands works in less (with the -R switch), but in Vim, the color characters are displayed raw like this:

^[[1;31mError:^[[0m Your fault.

I would do a syntax file to match these markers, conceal them, and color the resulting syntax regions accordingly, but first I wanted to check whether there is something like this already.

share|improve this question
    
... And it's very difficult to Google for that topic. Every query that includes "vim" and "colors" brings up hundreds of color schemes, which is not what I want. –  Stefan Majewsky Sep 12 '12 at 11:56
    
vim ansi color is quite helpful, though. –  SvW Sep 12 '12 at 12:09
add comment

1 Answer

up vote 3 down vote accepted

Have a look into this plugin, it's likely what you want:

AnsiEsc.vim : ansi escape sequences concealed, but highlighted as specified

share|improve this answer
    
Exactly. Thanks. –  Stefan Majewsky Sep 12 '12 at 12:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.