GithubHelp home page GithubHelp logo

pretty-sha-path.el's Introduction

About

This Emacs package provides minor-mode for prettifying Guix / 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 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 – pretty-symbols? pretty-symbols has 2 disadvantages (IMHO):

  • It is not possible to enable it globally.
  • Decomposition does not occur after disabling the mode, i.e. the paths would stay “prettified”.

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 EmacsWiki: Pretty Symbol.

pretty-sha-path.el's People

Contributors

alezost avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.