-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-ligature.el
61 lines (53 loc) · 2.55 KB
/
init-ligature.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
(provide 'init-ligature)
;; 参考:https://github.com/mickeynp/ligature.el/wiki
(use-package ligature
:straight (:type git :host github :repo "mickeynp/ligature.el")
:config
(ligature-set-ligatures 't '(
;; arrows
"==>"
"<=="
;; "-->" ;; not suitable for html and markdown mode
;; "<--"
;; "->"
;; "<-"
"~>"
"<~"
"~~>"
"<~~"
"<==>"
))
(ligature-set-ligatures '(python-mode) '(
;; arrows
"-->" ;; not suitable for html and markdown mode
"<--"
"->"
"<-"
;; equals
"!="
":="
">="
"<="
"=="
"//"
))
;; (ligature-set-ligatures
;; 'prog-mode
;; '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
;; ":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
;; "!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
;; "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
;; "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
;; "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
;; "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
;; "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
;; ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
;; "<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
;; "##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
;; "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
;; "\\\\" "://"))
:hook ((prog-mode org-mode markdown-mode gfm-mode) . ligature-mode)
)
(with-eval-after-load 'prog-mode
(add-hook 'python-mode-hook #'(lambda ()
(add-to-list 'python--prettify-symbols-alist '("->" . ?→)))))