alezost / pretty-sha-path.el

Prettify Guix/Nix store paths in Emacs
5 stars 2 forks source link

** 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:

+BEGIN_SRC emacs-lisp

(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)

+END_SRC

*** 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

Using programmatically in your emacs init file:

** 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]].