| ;; PRETTIFY SYMBOLS (with Pragmata Pro) | |
| (defun setup-pragmata-ligatures () | |
| (setq prettify-symbols-alist | |
| (append prettify-symbols-alist | |
| '(("!!" . ?) | |
| ("!=" . ?) | |
| ("!==" . ?) | |
| ("!≡" . ?) | |
| ("!≡≡" . ?) | |
| ("!>" . ?) | |
| ("#(" . ?) | |
| ("#_" . ?) | |
| ("#{" . ?) | |
| ("#?" . ?) | |
| ("#>" . ?) | |
| ("%=" . ?) | |
| ("%>" . ?) | |
| ("<~" . ?) | |
| ("&%" . ?) | |
| ("&&" . ?) | |
| ("&*" . ?) | |
| ("&+" . ?) | |
| ("&-" . ?) | |
| ("&/" . ?) | |
| ("&=" . ?) | |
| ("&&&" . ?) | |
| ("&>" . ?) | |
| ("$>" . ?) | |
| ("~>" . ?) | |
| ;; ("***" . ?) ; I prefer not to use this one | |
| ("*=" . ?) | |
| ("*/" . ?) | |
| ("*>" . ?) | |
| ("++" . ?) | |
| ("+++" . ?) | |
| ("+=" . ?) | |
| ("+>" . ?) | |
| ("--" . ?) | |
| ("-<" . ?) | |
| ("-<<" . ?) | |
| ("-=" . ?) | |
| ("->>" . ?) | |
| ("---" . ?) | |
| ("-->" . ?) | |
| (".." . ?) | |
| ("..." . ?) | |
| ("..<" . ?) | |
| (".>" . ?) | |
| (".~" . ?) | |
| (".=" . ?) | |
| ("/*" . ?) | |
| ("//" . ?) | |
| ("/>" . ?) | |
| ("/=" . ?) | |
| ("/==" . ?) | |
| ("///" . ?) | |
| ("/**" . ?) | |
| ("::" . ?) | |
| (":=" . ?) | |
| (":≡" . ?) | |
| (":>" . ?) | |
| (":=>" . ?) | |
| ("<$>" . ?) | |
| ("<*" . ?) | |
| ("<*>" . ?) | |
| ("<+>" . ?) | |
| ;; ("<-" . ?) ; I like different arrows (see below) | |
| ("<<" . ?) | |
| ("<<<" . ?) | |
| ("<<=" . ?) | |
| ("<=" . ?) | |
| ;; ("<=>" . ?) ; I like different arrows (see below) | |
| ("<>" . ?) | |
| ("<|>" . ?) | |
| ("<<-" . ?) | |
| ("<|" . ?) | |
| ("<=<" . ?) | |
| ("<~~" . ?) | |
| ("<<~" . ?) | |
| ("<$" . ?) | |
| ("<+" . ?) | |
| ("<!>" . ?) | |
| ("<@>" . ?) | |
| ("<#>" . ?) | |
| ("<%>" . ?) | |
| ("<^>" . ?) | |
| ("<&>" . ?) | |
| ("<?>" . ?) | |
| ("<.>" . ?) | |
| ("</>" . ?) | |
| ("<\>" . ?) | |
| ("<\">" . ?) | |
| ("<:>" . ?) | |
| ("<~>" . ?) | |
| ("<**>" . ?) | |
| ("<<^" . ?) | |
| ("<!" . ?) | |
| ("<@" . ?) | |
| ("<#" . ?) | |
| ("<%" . ?) | |
| ("<^" . ?) | |
| ("<&" . ?) | |
| ("<?" . ?) | |
| ("<." . ?) | |
| ("</" . ?) | |
| ("<\\" . ?) | |
| ("<\"" . ?) | |
| ("<:" . ?) | |
| ("<->" . ?) | |
| ("<!--" . ?) | |
| ("<--" . ?) | |
| ("=<<" . ?) | |
| ("==" . ?) | |
| ("===" . ?) | |
| ;; ("==>" . ?) ; I like different arrows (see below) | |
| ;; ("=>" . ?) ; I like different arrows (see below) | |
| ("=~" . ?) | |
| ("=>>" . ?) | |
| ("≡≡" . ?) | |
| ("≡≡≡" . ?) | |
| ("≡:≡" . ?) | |
| (">-" . ?) | |
| (">=" . ?) | |
| (">>" . ?) | |
| (">>-" . ?) | |
| (">>=" . ?) | |
| (">>>" . ?) | |
| (">=>" . ?) | |
| (">>^" . ?) | |
| ("??" . ?) | |
| ("?~" . ?) | |
| ("?=" . ?) | |
| ("?>" . ?) | |
| ("^=" . ?) | |
| ("^." . ?) | |
| ("^?" . ?) | |
| ("^.." . ?) | |
| ("^<<" . ?) | |
| ("^>>" . ?) | |
| ("^>" . ?) | |
| ("\\\\" . ?) | |
| ("\\>" . ?) | |
| ("@>" . ?) | |
| ("|=" . ?) | |
| ("||" . ?) | |
| ("|>" . ?) | |
| ("|||" . ?) | |
| ("|+|" . ?) | |
| ("~=" . ?) | |
| ("~~>" . ?) | |
| ("~>>" . ?) | |
| ;; Personal preference: I like this set of arrows better than default | |
| ("<-" . ?🡐) | |
| ("->" . ?🡒) | |
| ("=>" . ?⇒) | |
| ("<=>" . ?⟺) | |
| ("<==>" . ?⟺) | |
| ("==>" . ?⟹) | |
| ("<==" . ?⟸) | |
| ("|->" . ?⟼) | |
| ("<-|" . ?⟻) | |
| ("|=>" . ?⟾) | |
| ("<=|" . ?⟽) | |
| )))) | |
| (defun refresh-pretty () | |
| (prettify-symbols-mode -1) | |
| (prettify-symbols-mode +1)) | |
| ;; Hooks for modes in which to install the Pragmata ligatures | |
| (mapc (lambda (hook) | |
| (add-hook hook (lambda () (setup-pragmata-ligatures) (refresh-pretty)))) | |
| '(text-mode-hook | |
| prog-mode-hook)) | |
| (global-prettify-symbols-mode +1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
anantpaatra commentedAug 17, 2017
Do you mind sharing how you find the correct glyph character to use it in this code? I would like to build a similar map for other fonts that support ligature. Thanks!