easy-escape

https://github.com/cpitclaudel/easy-escape.git

git clone 'git://github.com/cpitclaudel/easy-escape.git'
2

easy-escape

Easy-escape: before and after

easy-escape-minor-mode composes double backslashes (escape characters) into single backslashes, and highlights them to improve readability. The underlying buffer text is not modified.

The default is to use a single \ character instead of two, but the character used and its color can be customized using easy-escape-face and easy-escape-character.

Screenshots

Using a custom color

Easy-escape: before and after

Using a custom character

Easy-escape: before and after

Setup

MELPA (preferred)

This will be valid if the package gets accepted on MELPA:

  1. Setup MELPA if you haven't yet

    In your .emacs, add these three lines:

    (require 'package)
    (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
    (package-initialize)
  2. Install the package: M-x package-install RET easy-escape RET

  3. Enable easy-escape-minor-mode in lisp buffers:

    ;; Replace 'lisp-mode-hook with 'prog-mode-hook to enable everywhere
    (add-hook 'lisp-mode-hook 'easy-escape-minor-mode)
    (add-hook 'emacs-lisp-mode-hook 'easy-escape-minor-mode)

Alternative setup

  1. Download this file

  2. Add this to your .emacs:

    (load-file "PATH-TO-THE-FILE-YOU-JUST-DOWNLOADED")
    (add-hook 'lisp-mode-hook 'easy-escape-minor-mode)

Fine-tuning