This package can be installed from MELPA (with
M-x package-install or
For the manual installation, clone the repo and add the directory to
(add-to-list 'load-path "/path/to/dim-dir") (when (require 'dim nil t) (dim-major-names ...) (dim-minor-names ...))
There are 4 functions, that you can use in your
So you can change the names by one, like this:
(dim-major-name 'scheme-mode "λ") (dim-major-name 'help-mode "🄷") (dim-minor-name 'isearch-mode " 🔎") (dim-minor-name 'view-mode " 👀" 'view)
Or you can set multiple names at once, like this:
(dim-major-names '((emacs-lisp-mode "EL") (inferior-emacs-lisp-mode "EL>") (calendar-mode "📆"))) (dim-minor-names '((visual-line-mode " ↩") (auto-fill-function " ↵") (eldoc-mode "" eldoc) (whitespace-mode " _" whitespace) (paredit-mode " ()" paredit)))
I prefer the latter variant as I like to keep all names in one place.
As you can see, the functions for major modes take a mode symbol (which
can be found by
M-: major-mode) and a new mode-line name.
The functions for minor modes also take a mode symbol (from
minor-mode-alist variable) and a new name, and optionally a feature or
file name where the minor mode comes from. It is passed to
eval-after-load function. If the feature or file name is not
specified, the mode name is changed immediately, but of course only if
the mode is already available, so the package feature shouldn’t be
specified only for the modes that are available right away on emacs
Note that mode-name should not necessarily be a string, it can be any mode-line construct supported by emacs. For example, you can configure mode-name to display images instead of text (see issue 8 for details).
So why this package, if we already have several packages for similar purposes?
The most well-known package is diminish. It is great, but it is only
for minor modes, also
diminish function can be called only when a
minor mode is available, so you have to wrap it into
(or you can use
:diminish keyword in use-package). For minor modes,
there is also rich-minority package, which allows to hide and highlight
For major modes, there is cyphejor package, which allows to make complex
rules for changing parts of mode names. It can be also used for
automatic abbreviation of these parts. In contrast,
dim is very
simple and straight-forward: you just assign a new mode-line string to a
mode name (symbol) and that’s it.
As for the delight package, the main reason is: I don’t like that it
mixes minor and major modes (they are set by
delight function and
delighted-modes variable). They are essentially different
things and should be treated independently. Also
“developed” on the wiki, which is not convenient for using and
contributing. And finally, I don’t like some parts of the code (like
delight function — it should be a top-level form!).
But I say many thanks to the author of
delight package as the code of
dim is heavily based on it.