mirror of
https://github.com/Foltik/dotfiles
synced 2024-11-23 20:20:53 -05:00
Add pretty-font-mode for ligatures
This commit is contained in:
parent
541b24e970
commit
f8cae643cf
@ -1014,26 +1014,31 @@ from blanket trimming entire files.
|
|||||||
(use-package pretty-mode
|
(use-package pretty-mode
|
||||||
:hook (prog-mode . pretty-mode)
|
:hook (prog-mode . pretty-mode)
|
||||||
:config
|
:config
|
||||||
(pretty-deactivate-groups '(:arithmetic
|
(pretty-deactivate-groups '(:equality
|
||||||
:sub-and-superscripts))
|
:ordering
|
||||||
(pretty-activate-groups '(:equality
|
:ordering-double
|
||||||
:ordering
|
:ordering-triple
|
||||||
:ordering-double
|
:arrows
|
||||||
:ordering-triple
|
:arrows-twoheaded
|
||||||
:arrows
|
:punctuation
|
||||||
:arrows-twoheaded
|
:logic
|
||||||
:punctuation
|
:sets))
|
||||||
:logic
|
|
||||||
:sets)))
|
(pretty-activate-groups '(:sub-and-superscripts
|
||||||
|
:greek
|
||||||
|
:arithmetic-nary)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Prettify-Symbols-Mode
|
*** Prettify-Symbols-Mode
|
||||||
Allows custom unicode replacement of symbols. Fill in the gaps where
|
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
|
**** Python
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun jf-prettify-python ()
|
(defun jf-prettify-python ()
|
||||||
(dolist (pair '(;; Syntax
|
(dolist (pair
|
||||||
|
;; Syntax
|
||||||
|
'(("def" . #x2131)
|
||||||
|
("not" . #x2757)
|
||||||
("in" . #x2208)
|
("in" . #x2208)
|
||||||
("not in" . #x2209)
|
("not in" . #x2209)
|
||||||
("return" . #x27fc)
|
("return" . #x27fc)
|
||||||
@ -1044,12 +1049,35 @@ pretty-mode left off.
|
|||||||
("float" . #x211d)
|
("float" . #x211d)
|
||||||
("str" . #x1d54a)
|
("str" . #x1d54a)
|
||||||
("True" . #x1d54b)
|
("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)))
|
(push pair prettify-symbols-alist)))
|
||||||
|
|
||||||
(add-hook 'python-mode-hook #'prettify-symbols-mode)
|
(add-hook 'python-mode-hook #'prettify-symbols-mode)
|
||||||
(add-hook 'python-mode-hook #'jf-prettify-python)
|
(add-hook 'python-mode-hook #'jf-prettify-python)
|
||||||
#+END_SRC
|
#+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
|
** Checkers
|
||||||
*** Flycheck
|
*** Flycheck
|
||||||
Flycheck highlights syntax errors in a few languages.
|
Flycheck highlights syntax errors in a few languages.
|
||||||
|
Loading…
Reference in New Issue
Block a user