Skip to content

Instantly share code, notes, and snippets.

@cabo
Created July 13, 2014 13:25
Show Gist options
  • Save cabo/e32c74d73e98d4b08451 to your computer and use it in GitHub Desktop.
Save cabo/e32c74d73e98d4b08451 to your computer and use it in GitHub Desktop.
Emacs lisp snippet to turn Elixir into a charming language (during editing only)
(defconst elixir--cabo-prettify-symbols-alist
'(
("->" . ?➙) ; → ➜➽➤
("::" . ?∷)
("<-" . ?⬅) ; ←
("<<" . ?⟪ ) ; «≪
("=>" . ?⇒)
(">>" . ?⟫ ) ; »≫
("do" . ?⫷)
("do:" . ?⨸) ; ❢ ⋮ ⪓ ⪣ ⫶ ⧴ ⧔ ⋮ ÷ ≑ ≕ ⊰ ⨷ ⧥ ⨸
("end" . ?⫸)
("fn" . ?Ƒ) ; ?λ⩹
("for" . ?∀)
("when" . ?⨇) ; ⫿ ⎮∣ ⫼
("|>" . ?⩥) ; ➤➧➲➽⇛⇥⇶⇉⇢➾☞
))
(defun elixir-cabo ()
(setq-local prettify-symbols-alist elixir--cabo-prettify-symbols-alist)
(prettify-symbols-mode 1))
(add-hook 'elixir-mode-hook 'elixir-cabo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment