0

I've been playing around with ranger in emacs and I'm really liking it for browsing new codebases. I would like to get syntax highlighting working, as it does when using ranger in a terminal. I'm not seeing much documentation around getting it working in ranger code previews in emacs.

MacOS

$ brew install ranger
$ brew install highlight
$ ranger --copy-config=all
$ ranger

this installs and launches ranger from the terminal and does syntax highlighting when I select most files containing code (.sh, .py, .go, .json, etc) . Also populated ~/.config/ranger with scope.sh, etc

Emacs init.el

(use-package ranger :ensure t)
(use-package highlight :ensure t)   

ranger works great in emacs when I launch using M-x ranger, but I have no syntax highlighting when I select any files containing python, bash, go, etc code.

seans
  • 101
  • 2
  • Please clarify *how* you use ranger (i.e. after which operations do you fail to see syntax highlighting) – Stefan Nov 26 '19 at 16:30
  • updated my question to hopefully clarify – seans Nov 26 '19 at 20:58
  • 2
    According to the [`ranger.el` docs](https://github.com/ralesi/ranger.el#window-conventions-for-range), _Selected files are previewed literally (raw) without any formatting, by default. To toggle between a fully formatted or a literal preview, press: `zi`..._ Have you tried that? – nega Nov 27 '19 at 14:39
  • yes, `zi` works. I missed that in the docs. Do you want to submit an answer so I can accept? – seans Nov 30 '19 at 17:02

0 Answers0