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?

$ sudo apt-get install highlight

then reopen ranger.

  • 1
    sudo pacman -S highlight worked on Arch for me. – Kevin Mar 18 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.