Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. – Sven Sep 12 '12 at 12:09
up vote 4 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

Your Answer


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.