I obtain a similar thing by adding this snippet to my .zshrc[0]. Notice I use bat[1] and exa[2] as alternative to cat and ls.
This is the result: https://gfycat.com/brokengiantcockerspaniel
[0]: https://github.com/silvanocerza/dotfiles/blob/master/zsh/zsh...