vimansi-escapeansi-colorscolor-codes

ANSI Color Codes in VIM


I have a script that generates a log file with ANSI color codes in them like so:

[2012-05-14 18:00:02] ^[[0mINF: -- Starting update script --^[[0m
[2012-05-14 18:00:29] ^[[91mERR: Improper date, entry being ignored.^[[0m

Is there any way to get Vim to understand these color codes?

Thanks for any help.


Solution

  • Use Charles Campbell's (Dr Chip) AnsiEsc plugin:

    http://www.vim.org/scripts/script.php?script_id=302

    Before:

    before

    :AnsiEsc<CR>

    after