From f8cae643cf094424b0c15b8bd35ca4d58b61c95c Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Sat, 7 Sep 2019 11:09:13 -0400 Subject: [PATCH] Add pretty-font-mode for ligatures --- lain/.emacs.d/config.org | 56 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/lain/.emacs.d/config.org b/lain/.emacs.d/config.org index 2e45e6b..28c437e 100644 --- a/lain/.emacs.d/config.org +++ b/lain/.emacs.d/config.org @@ -1014,26 +1014,31 @@ from blanket trimming entire files. (use-package pretty-mode :hook (prog-mode . pretty-mode) :config - (pretty-deactivate-groups '(:arithmetic - :sub-and-superscripts)) - (pretty-activate-groups '(:equality - :ordering - :ordering-double - :ordering-triple - :arrows - :arrows-twoheaded - :punctuation - :logic - :sets))) + (pretty-deactivate-groups '(:equality + :ordering + :ordering-double + :ordering-triple + :arrows + :arrows-twoheaded + :punctuation + :logic + :sets)) + + (pretty-activate-groups '(:sub-and-superscripts + :greek + :arithmetic-nary))) #+END_SRC *** Prettify-Symbols-Mode Allows custom unicode replacement of symbols. Fill in the gaps where -pretty-mode left off. +pretty-mode left off. See list of unicode symbols that can be used [[https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode][here]]. **** Python #+BEGIN_SRC emacs-lisp (defun jf-prettify-python () - (dolist (pair '(;; Syntax + (dolist (pair + ;; Syntax + '(("def" . #x2131) + ("not" . #x2757) ("in" . #x2208) ("not in" . #x2209) ("return" . #x27fc) @@ -1044,12 +1049,35 @@ pretty-mode left off. ("float" . #x211d) ("str" . #x1d54a) ("True" . #x1d54b) - ("False" . #x1d53d))) + ("False" . #x1d53d) + ;; Mypy + ("Dict" . #x1d507) + ("List" . #x2112) + ("Tuple" . #x2a02) + ("Set" . #x2126) + ("Iterable" . #x1d50a) + ("Any" . #x2754) + ("Union" . #x22c3))) (push pair prettify-symbols-alist))) (add-hook 'python-mode-hook #'prettify-symbols-mode) (add-hook 'python-mode-hook #'jf-prettify-python) #+END_SRC +*** Pretty fonts +#+BEGIN_SRC emacs-lisp + (use-package pretty-fonts + :load-path jf-load-path + :config + (pretty-fonts-add-hook 'prog-mode-hook pretty-fonts-fira-code-alist) + (pretty-fonts-add-hook 'org-mode-hook pretty-fonts-fira-code-alist) + (pretty-fonts-set-fontsets-for-fira-code)) +#+END_SRC +*** Rainbow Delimiters +Make it easier to spot sexp depth by pairing delimiter colors. +#+BEGIN_SRC emacs-lisp + (use-package rainbow-delimiters + :hook (prog-mode . rainbow-delimiters-mode)) +#+END_SRC ** Checkers *** Flycheck Flycheck highlights syntax errors in a few languages.