Set ligatures more generally

This commit is contained in:
Tobias Ostner 2024-06-29 11:56:25 +02:00
parent b48675956b
commit 58f2110aa5

View file

@ -347,15 +347,29 @@
(use-package ligature (use-package ligature
:after fontaine :after fontaine
:config :config
(defun to/set-ligatures-for-font-iosevka () (defun to/set-ligatures-for-font (font-family)
(when (string= "Iosevka Comfy" (face-attribute 'default :family)) (let ((ligatures
(ligature-set-ligatures (cond ((string= font-family "Iosevka Comfy")
'prog-mode '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--" '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->"
"<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---" "<---->" "<!--" "<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">="
"<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!==" "<=>" "<==>" "<===>" "<====>" "<!---" "<~~" "<~" "~>" "~~>" "::"
":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++")))) ":::" "==" "!=" "===" "!==" ":=" ":-" ":+" "<*" "<*>" "*>" "<|"
"<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"))
((string= font-family "Cascadia Code")
'("www" "--" "---" "-~" "(*" "{|" "}#" "[|" "]#" ".-" ".." "..." "..="
"..<" ".?" ".=" "::" ":::" "::=" ":=" "://" ";;" "!." "!:" "!!" "!!."
"!=" "!==" "?." "?:" "??" "??=" "?=" "*)" "**" "***" "*>" "*/" "#("
"#{" "#[" "#:" "#!" "#?" "#=" "#_" "#_(" "/*" "/>" "//" "///" "/\\"
"\\\\" "&&" "|}" "|]" "||" "|||" "|||>" "|>" "$>" "++" "+++" "+>" "=="
"===" "=>>" "=<<" ">=" ">>" ">>=" ">>>" "<!--" "<*" "<*>" "<|" "<||"
"<|||" "<|>" "<$" "<$>" "<+" "<+>" "<=" "<>" "<<" "<<=" "<<<" "<~"
"<~>" "<~~" "</" "</>" "~-" "~@" "~=" "~>" "~~" "~~>" "^=" "%%"))
(t
'()))))
(when (string= font-family (face-attribute 'default :family))
(ligature-set-ligatures 'prog-mode ligatures))))
(to/set-ligatures-for-font-iosevka) (to/set-ligatures-for-font (face-attribute 'default :family))
(global-ligature-mode t)) (global-ligature-mode t))
(use-package magit (use-package magit
@ -363,7 +377,7 @@
(use-package magit-todos (use-package magit-todos
:after magit :after magit
:config :configp
(magit-todos-mode 1)) (magit-todos-mode 1))
(use-package marginalia (use-package marginalia