emacs init: Display Lambda as λ
Show Lambda As λ
- Alt+x
prettify-symbols-mode -
Display the word “lambda” as λ, in current buffer.
(New in Emacs 24.4 (date 2014-10).)
- Alt+x
global-prettify-symbols-mode -
Globally. Put this in your Emacs Init File:
(global-prettify-symbols-mode 1)
Add Support for Pretty Symbols Mode
prettify-symbols-mode only works for major modes that supports it.
To add support, in your major mode, do:
(setq prettify-symbols-alist '(("lambda" . 955)))
The 955 is Unicode codepoint for λ in decimal. [see Emacs: find char name, font, position, code point, encoding, etc]
You can add other pairs. For example, to have arrow, do:
(setq prettify-symbols-alist '( ("lambda" . 955) ; λ ("->" . 8594) ; → ("=>" . 8658) ; ⇒ ("map" . 8614) ; ↦ ))
You can add it as a Hook for any major mode. Here's a example:
(defun my-add-pretty-symbol () "make some word display as Unicode symbols" (setq prettify-symbols-alist '( ("lambda" . 955) ; λ ("->" . 8594) ; → ("=>" . 8658) ; ⇒ ("map" . 8614) ; ↦ ))) (add-hook 'clojure-mode-hook 'my-add-pretty-symbol) (add-hook 'haskell-mode-hook 'my-add-pretty-symbol) (add-hook 'tex-mode-hook 'my-add-pretty-symbol)
For other math symbols you might want to add, see: