Files
sydnix/modules/home/users/msyds/emacs/lisp/syd/ligature.el
Madeleine Sydney Ślaga c0b60ff0e4
All checks were successful
build / build (push) Successful in 2m40s
feat(emacs): toki pona ligatures
2026-03-30 13:20:18 -06:00

38 lines
1.4 KiB
EmacsLisp
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;;; -*- lexical-binding: t; -*-
(require 'syd/base)
(use-package ligature
:config
(ligature-set-ligatures 'prog-mode
'("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||="
"||>" ":::" "::=" "=:=" "===" "==>" "=!=" "=>>"
"=<<" "=/=" "!==" "!!." ">=>" ">>=" ">>>" ">>-"
">->" "->>" "-->" "---" "-<<" "<~~" "<~>" "<*>"
"<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->" "<--"
"<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_("
"..<" "..." "+++" "/==" "///" "_|_" "www" "&&" "^="
"~~" "~@" "~=" "~>" "~-" "**" "*>" "*/" "||" "|}"
"|]" "|=" "|>" "|-" "{|" "[|" "]#" "::" ":=" ":>"
":<" "$>" "==" "=>" "!=" "!!" ">:" ">=" ">>" ">-"
"-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:" "<$"
"<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#="
"#!" "##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?"
"+>" "++" "?:" "?=" "?." "??" ";;" ";;;"
"/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
"\\\\" "://"))
;; Sitelen pona glyphs.
(rx-let ((ideograph (any (#xF1900 . #xF198C)))
(tok-punct (any "󱦜" "󱦝"))
(arrow (any "←-↙"))
(zwj ""))
(ligature-set-ligatures
'fundamental-mode
`(("󱦐" ,(rx (* (or ideograph tok-punct))))
("󱥍" ,(rx "󱦗" (* (or ideograph tok-punct)) "󱦘"))
("󱥁" ,(rx zwj arrow))
("󱤑" ,(rx zwj ideograph)))))
(global-ligature-mode 1))
(provide 'syd/ligature)