** About
This Emacs package provides minor-mode for prettifying [[http://www.gnu.org/software/guix/][Guix]] / [[http://nixos.org/][Nix]] store paths by replacing SHA-sequences with ellipsis, i.e.:
: /gnu/store/72f54nfp6g1hz873w8z3gfcah0h4nl9p-foo-0.1 → /gnu/store/…-foo-0.1 : /nix/store/nh4n4yzb1bx7nss2rg342dz44g14m06x-bar-0.2 → /nix/store/…-bar-0.2
Screenshot: [[http://i.imgur.com/NpvP8OR.png]]
** Installation
*** Automatic
This package is avalable on [[http://melpa.milkbox.net][MELPA]].
*** Manual
As usual for the manual installation, add a directory with =pretty-sha-path.el= to the =load-path= and add necessary autoloads:
(add-to-list 'load-path "/path/to/pretty-sha-path") (autoload 'pretty-sha-path-mode "pretty-sha-path" nil t) (autoload 'global-pretty-sha-path-mode "pretty-sha-path" nil t)
*** Guix
=pretty-sha-path= is also distributed with GNU Guix (since Guix 0.8), so if you have Guix installed, this package is already installed. The only difference is that it is called =guix-prettify= there.
** Usage
Enable/disable prettifying for the current buffer: : M-x pretty-sha-path-mode
Enable/disable prettifying globally: : M-x global-pretty-sha-path-mode
Using programmatically in your emacs init file:
Enable only for some modes:
(add-hook 'shell-mode-hook 'pretty-sha-path-mode) (add-hook 'dired-mode-hook 'pretty-sha-path-mode)
Or enable globally on emacs start:
(global-pretty-sha-path-mode)
** Why?
So why does this package exist if there is a more general solution – [[http://github.com/drothlis/pretty-symbols][pretty-symbols]]? =pretty-symbols= has 2 disadvantages (IMHO):
So if you are not going to disable it and use it globally, then =pretty-symbols-mode= will probably be a better call.
/Note:/ There is also =prettify-symbols-mode= which is a part of Emacs 24.4. It is great for prettifying symbols (like "lambda") but it does not support regexps.
For other analogous packages, see [[http://www.emacswiki.org/emacs-en/PrettySymbol][EmacsWiki: Pretty Symbol]].