One thing is that lolcat
knows how to add colors when writing to a terminal, so by default it will only add colors when it knows it's doing that. When you run lolcat
from Vim, it's actually writing to a pipe instead. You can force it to add the colors by using lolcat -f
(for --force
) instead.
But then, what you'll see is that lolcat
is actually adding colors by producing output that includes escape sequences that a terminal recognizes as commands to change colors. Vim doesn't really interpret those by default, and will show them literally, these will look like sequences of ^[[37;41m
or ^[[0m
etc.
In order to have Vim actually interpret these sequences and render those as colors, you can use a plug-in. For example, install plug-in chrisbra/Colorizer
and use the command :ColorHighlight
after you have the lolcat -f
output with the escape sequences in your buffer.