From cf0813bc7c5f111644113725575ae3eb68643fd9 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 30 Aug 2023 16:55:04 +0200 Subject: [PATCH] Use ligatures instead of prettify-symbols --- configuration.org | 84 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/configuration.org b/configuration.org index 54f22ae..c2e70f8 100644 --- a/configuration.org +++ b/configuration.org @@ -128,6 +128,80 @@ (trailing-whitespace ((t (:inherit nil :background "red3"))))) #+end_src +** Use ligatures + +#+begin_src emacs-lisp +(use-package ligature + :config + ;; Enable the "www" ligature in every possible major mode + (ligature-set-ligatures 't '("www")) + ;; Enable traditional ligature support in eww-mode, if the + ;; `variable-pitch' face supports it + (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi")) + ;; Enable all Cascadia and Fira Code ligatures in programming modes + (ligature-set-ligatures 'prog-mode + '(;; == === ==== => =| =>>=>=|=>==>> ==< =/=//=// =~ + ;; =:= =!= + ("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "=")))) + ;; ;; ;;; + (";" (rx (+ ";"))) + ;; && &&& + ("&" (rx (+ "&"))) + ;; !! !!! !. !: !!. != !== !~ + ("!" (rx (+ (or "=" "!" "\." ":" "~")))) + ;; ?? ??? ?: ?= ?. + ("?" (rx (or ":" "=" "\." (+ "?")))) + ;; %% %%% + ("%" (rx (+ "%"))) + ;; |> ||> |||> ||||> |] |} || ||| |-> ||-|| + ;; |->>-||-<<-| |- |== ||=|| + ;; |==>>==<<==<=>==//==/=!==:===> + ("|" (rx (+ (or ">" "<" "|" "/" ":" "!" "}" "\]" + "-" "=" )))) + ;; \\ \\\ \/ + ("\\" (rx (or "/" (+ "\\")))) + ;; ++ +++ ++++ +> + ("+" (rx (or ">" (+ "+")))) + ;; :: ::: :::: :> :< := :// ::= + (":" (rx (or ">" "<" "=" "//" ":=" (+ ":")))) + ;; // /// //// /\ /* /> /===:===!=//===>>==>==/ + ("/" (rx (+ (or ">" "<" "|" "/" "\\" "\*" ":" "!" + "=")))) + ;; .. ... .... .= .- .? ..= ..< + ("\." (rx (or "=" "-" "\?" "\.=" "\.<" (+ "\.")))) + ;; -- --- ---- -~ -> ->> -| -|->-->>->--<<-| + ("-" (rx (+ (or ">" "<" "|" "~" "-")))) + ;; *> */ *) ** *** **** + ("*" (rx (or ">" "/" ")" (+ "*")))) + ;; www wwww + ("w" (rx (+ "w"))) + ;; <>