summaryrefslogtreecommitdiffstats
path: root/lisp/init-mac.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/init-mac.el')
-rw-r--r--lisp/init-mac.el34
1 files changed, 33 insertions, 1 deletions
diff --git a/lisp/init-mac.el b/lisp/init-mac.el
index a049edd..6108439 100644
--- a/lisp/init-mac.el
+++ b/lisp/init-mac.el
@@ -3,7 +3,39 @@
(let ((font-family "Fira Code"))
(when (and (display-graphic-p) (member font-family (font-family-list)))
(set-face-attribute 'default nil :family (concat font-family " Retina"))
- (set-face-attribute 'default nil :height 140)))
+ (set-face-attribute 'default nil :height 140)
+
+ ;; configure ligatures
+ ;; https://github.com/tonsky/FiraCode/wiki/Emacs-instructions
+ (let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)")
+ (35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)")
+ (36 . ".\\(?:>\\)")
+ (37 . ".\\(?:\\(?:%%\\)\\|%\\)")
+ (38 . ".\\(?:\\(?:&&\\)\\|&\\)")
+ (42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)")
+ (43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)")
+ (45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)")
+ (46 . ".\\(?:\\(?:\\.[.<]\\)\\|[.=-]\\)")
+ (47 . ".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)")
+ (48 . ".\\(?:x[a-zA-Z]\\)")
+ (58 . ".\\(?:::\\|[:=]\\)")
+ (59 . ".\\(?:;;\\|;\\)")
+ (60 . ".\\(?:\\(?:!--\\)\\|\\(?:~~\\|->\\|\\$>\\|\\*>\\|\\+>\\|--\\|<[<=-]\\|=[<=>]\\||>\\)\\|[*$+~/<=>|-]\\)")
+ (61 . ".\\(?:\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\)\\|[<=>~]\\)")
+ (62 . ".\\(?:\\(?:=>\\|>[=>-]\\)\\|[=>-]\\)")
+ (63 . ".\\(?:\\(\\?\\?\\)\\|[:=?]\\)")
+ (91 . ".\\(?:]\\)")
+ (92 . ".\\(?:\\(?:\\\\\\\\\\)\\|\\\\\\)")
+ (94 . ".\\(?:=\\)")
+ (119 . ".\\(?:ww\\)")
+ (123 . ".\\(?:-\\)")
+ (124 . ".\\(?:\\(?:|[=|]\\)\\|[=>|]\\)")
+ (126 . ".\\(?:~>\\|~~\\|[>=@~-]\\)")
+ )
+ ))
+ (dolist (char-regexp alist)
+ (set-char-table-range composition-function-table (car char-regexp)
+ `([,(cdr char-regexp) 0 font-shape-gstring]))))))
;; configure modifiers
(setq mac-option-modifier 'super)