Well, vim
uses color template files for syntax highlighting. This has nothing to do with the output of grep
which uses ANSI escape sequences (the \[033;
stuff you mentioned).
My vim doesn't have a style file for syslog and does not color it (I checked both on Debian and on Ubuntu 14.04). If you look at the relevant file on your system, you will find it starts with a regular expression that defines the files to match against. So, if you make your /tmp/fileOUT
match that syntax, it should be colored. Don't use --color=always
, that will just screw things up.
Alternatively, you could use source-highlight
. Install it with sudo apt-get install source-highlight
and then run:
sudo tail -n 50 /var/log/syslog | source-highlight --out-format=esc -o STDOUT -s log
The command above will color the last 50 lines of /var/log/syslog
:
