Color Identifiers is a minor mode for Emacs that highlights each source code identifier uniquely based on its name. It is inspired by a post by Evan Brooks.
Currently it supports scala-mode2, js-mode, js2-mode, ruby-mode, python-mode, and emacs-lisp-mode. You can add support for your favorite mode by modifying color-identifiers:modes-alist
and optionally calling color-identifiers:set-declaration-scan-fn
.
It picks colors adaptively to fit the theme:
Use M-x color-identifiers:regenerate-colors
after a theme change.
Color Identifiers is in MELPA. First set up MELPA:
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-refresh-contents)
Then install it:
(package-install 'color-identifiers-mode)
Finally, visit a Scala file and type M-x color-identifiers-mode
.
If you like it, enable it for all Scala files:
(add-hook 'scala-mode-hook 'color-identifiers-mode)