How to enable syntax highlighting in ranger preview

rangersyntax highlighting

I have seen some screenshots where ranger uses syntax-highlighting in its preview window. So I was wondering how to enable this feature and found out that I need the scope.sh file in the directory
/home/user/.config/ranger/scop.sh,
which will be generated with the command
$ ranger --copy-config=scope.
After generating it however the preview window completely disappears,
although I inserted set use_preview_script true in rc.config.

Q: Does someone know how to enable syntax-highlighting (especially for C/C++) in the ranger preview window?

Best Answer

$ sudo apt-get install highlight

then reopen ranger.

Related Question