Vim syntax file for ANSI-colored output of CLI apps

colorssyntax highlightingvim

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.

Best Answer

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

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

Related Question