diff --git a/Emacs-instructions.md b/Emacs-instructions.md index b5e8bce..627aef6 100644 --- a/Emacs-instructions.md +++ b/Emacs-instructions.md @@ -8,6 +8,7 @@ There are a few options when it comes down to using ligatures in Emacs. They are listed in order of preferred to less-preferred. Pick one! - [Using composition mode in Emacs Mac port](#using-composition-mode-in-emacs-mac-port) +- [ligature.el](#ligature.el) - [Using prettify-symbols](#using-prettify-symbols) - [Using composition char table](#using-composition-char-table) - [Using font-lock keywords](#using-font-lock-keywords) @@ -21,6 +22,29 @@ of Emacs (by Mitsuharu Yamamoto) for macOS, you can use: (mac-auto-operator-composition-mode) ``` +### ligature.el + +If you're using a modern version of emacs, you might have ligature support built-in, via HARFBUZZ / Cairo. The [ligature.el](https://github.com/mickeynp/ligature.el) package adds infrastructure that uses Harfbuzz and Cairo to render ligatures from the fonts, just like in any other editor. Add the following to your `init.el` file: + +```elisp +;; Enable the www ligature in every possible major mode +(ligature-set-ligatures 't '("www")) + +;; Enable ligatures in programming modes +(ligature-set-ligatures 'prog-mode '("www" "**" "***" "**/" "*>" "*/" "\\\\" "\\\\\\" "{-" "::" + ":::" ":=" "!!" "!=" "!==" "-}" "----" "-->" "->" "->>" + "-<" "-<<" "-~" "#{" "#[" "##" "###" "####" "#(" "#?" "#_" + "#_(" ".-" ".=" ".." "..<" "..." "?=" "??" ";;" "/*" "/**" + "/=" "/==" "/>" "//" "///" "&&" "||" "||=" "|=" "|>" "^=" "$>" + "++" "+++" "+>" "=:=" "==" "===" "==>" "=>" "=>>" "<=" + "=<<" "=/=" ">-" ">=" ">=>" ">>" ">>-" ">>=" ">>>" "<*" + "<*>" "<|" "<|>" "<$" "<$>" "