prettify-custom-symbols.el 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. (add-hook 'prog-mode-hook
  2. (lambda ()
  3. (setq prettify-symbols-alist
  4. (append
  5. '(
  6. ("->" . ?→)
  7. ("lambda" . ?λ)
  8. ("->" . ?→)
  9. ("<=" . ?≤)
  10. (">=" . ?≥)
  11. ("!=" . ?≠)) prettify-symbols-alist))))
  12. ;; List from https://github.com/cpitclaudel/.emacs.d/blob/master/lisp/prettify-alists/haskell-prettify.el
  13. (add-hook 'haskell-mode-hook
  14. (lambda ()
  15. (setq prettify-symbols-alist
  16. (append
  17. '(;; Double-struck letters
  18. ("|A|" . ?𝔸)
  19. ("|B|" . ?𝔹)
  20. ("|C|" . ?ℂ)
  21. ("|D|" . ?𝔻)
  22. ("|E|" . ?𝔼)
  23. ("|F|" . ?𝔽)
  24. ("|G|" . ?𝔾)
  25. ("|H|" . ?ℍ)
  26. ("|I|" . ?𝕀)
  27. ("|J|" . ?𝕁)
  28. ("|K|" . ?𝕂)
  29. ("|L|" . ?𝕃)
  30. ("|M|" . ?𝕄)
  31. ("|N|" . ?ℕ)
  32. ("|O|" . ?𝕆)
  33. ("|P|" . ?ℙ)
  34. ("|Q|" . ?ℚ)
  35. ("|R|" . ?ℝ)
  36. ("|S|" . ?𝕊)
  37. ("|T|" . ?𝕋)
  38. ("|U|" . ?𝕌)
  39. ("|V|" . ?𝕍)
  40. ("|W|" . ?𝕎)
  41. ("|X|" . ?𝕏)
  42. ("|Y|" . ?𝕐)
  43. ("|Z|" . ?ℤ)
  44. ("|gamma|" . ?ℽ)
  45. ("|Gamma|" . ?ℾ)
  46. ("|pi|" . ?ℼ)
  47. ("|Pi|" . ?ℿ)
  48. ;; Types
  49. ("::" . ?∷)
  50. ;; Quantifiers
  51. ("forall" . ?∀)
  52. ("exists" . ?∃)
  53. ;; Arrows
  54. ("-->" . ?⟶)
  55. ("<-" . ?←)
  56. ("<--" . ?⟵)
  57. ("<->" . ?↔)
  58. ("<-->" . ?⟷)
  59. ("=>" . ?⇒)
  60. ("==>" . ?⟹)
  61. ("<==" . ?⟸)
  62. ("<=>" . ?⇔)
  63. ("<==>" . ?⟺)
  64. ("|->" . ?↦)
  65. ("|-->" . ?⟼)
  66. ("<-|" . ?↤)
  67. ("<--|" . ?⟻)
  68. ("|=>" . ?⤇)
  69. ("|==>" . ?⟾)
  70. ("<=|" . ?⤆)
  71. ("<==|" . ?⟽)
  72. ("~>" . ?⇝)
  73. ("<~" . ?⇜)
  74. (">->" . ?↣)
  75. ("<-<" . ?↢)
  76. ("->>" . ?↠)
  77. ("<<-" . ?↞)
  78. (">->>" . ?⤖)
  79. ("<<-<" . ?⬻)
  80. ("<|-" . ?⇽)
  81. ("-|>" . ?⇾)
  82. ("<|-|>" . ?⇿)
  83. ("<-/-" . ?↚)
  84. ("-/->" . ?↛)
  85. ("<-|-" . ?⇷)
  86. ("-|->" . ?⇸)
  87. ("<-|->" . ?⇹)
  88. ("<-||-" . ?⇺)
  89. ("-||->" . ?⇻)
  90. ("<-||->" . ?⇼)
  91. ("-o->" . ?⇴)
  92. ("<-o-" . ?⬰)
  93. ;; Boolean operators
  94. ("not" . ?¬)
  95. ("&&" . ?∧)
  96. ("||" . ?∨)
  97. ;; Relational operators
  98. ("==" . ?≡)
  99. ("/=" . ?≠)
  100. ("<=" . ?≤)
  101. (">=" . ?≥)
  102. ("/<" . ?≮)
  103. ("/>" . ?≯)
  104. ;; Containers / Collections
  105. ("++" . ?⧺)
  106. ("+++" . ?⧻)
  107. ("|||" . ?⫴)
  108. ("empty" . ?∅)
  109. ("elem" . ?∈)
  110. ("notElem" . ?∉)
  111. ("member" . ?∈)
  112. ("notMember" . ?∉)
  113. ("union" . ?∪)
  114. ("intersection" . ?∩)
  115. ("isSubsetOf" . ?⊆)
  116. ("isProperSubsetOf" . ?⊂)
  117. ;; Other
  118. ("<<" . ?≪)
  119. (">>" . ?≫)
  120. ("<<<" . ?⋘)
  121. (">>>" . ?⋙)
  122. ("<|" . ?⊲)
  123. ("|>" . ?⊳)
  124. ("><" . ?⋈)
  125. ("mempty" . ?∅)
  126. ("mappend" . ?⊕)
  127. ("<*>" . ?⊛)
  128. ("undefined" . ?⊥)
  129. (":=" . ?≔)
  130. ("=:" . ?≕)
  131. ("=def" . ?≝)
  132. ("=?" . ?≟)
  133. ("..." . ?…)) prettify-symbols-alist))))
  134. (setq python--prettify-symbols-alist
  135. '(("def" . #x2131)
  136. ("not" . #x2757)
  137. ("return" . #x27fc)
  138. ("yield" . #x27fb)
  139. ("or" . ?∨)
  140. ("and" . ?∧)
  141. ("None" . ?⊥)
  142. ("set()" . ?∅)
  143. ("not in" . ?∉)
  144. ("in" . ?∈)
  145. ("is not" . ?≢)
  146. ("is" . ?≡)))
  147. (provide 'prettify-custom-symbols)