3.5 KiB
Fonts
Unified system font across Emacs.
Setup
Install the required firacode
1 font before loading the module:
RUN apt install -y fonts-firacode
Config
Write out the value of dotfiles/font
to all of the available font faces supported by Emacs. By default, this uses firacode
1 for its readability and ligature support. All of the heights are configured to dotfiles/font-size
by default, with further configuration based on the given size possible.
(set-face-attribute 'default nil :font dotfiles/font :height dotfiles/font-size) (set-face-attribute 'fixed-pitch nil :font dotfiles/font :height dotfiles/font-size) (set-face-attribute 'variable-pitch nil :font dotfiles/font :height dotfiles/font-size)
Icons
Emacs feels more modern with prioritized icon fonts, available in the all-the-icons
2 package. This makes navigation and visually parsing directories much faster, given that the file types are quickly identified by their corresponding icons.
(use-package all-the-icons)
Integration with the built-in dired
package is available in the all-the-icons-dired
3 package.
(use-package all-the-icons-dired :hook (dired-mode . all-the-icons-dired-mode))
Emojis
It's finally here, first class support for Emojis in Emacs via the emacs-emojify
4 package. Have we finally gone too far?
(use-package emojify :when (window-system) :hook (after-init . global-emojify-mode))
Ligatures
Parenthesis
Colourize nested parenthesis with rainbow-delimeters
4, a mandatory life-jacked to keep you from drowning in the sea of them in Lisp.
(use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode))
Text scaling
Define a transient keybinding for scaling the text. One caveat to this, it only works when Emacs is running as a GUI application, and has no effect in the terminal.
(defhydra hydra-text-scale (:timeout 4) "Scale" ("j" text-scale-increase "Increase") ("k" text-scale-decrease "Decrease") ("f" nil "Finished" :exit t))
Shortcuts
Scale the text inside of buffers using the custom transient binding, behind SPC t f
:
-
Increase with
j
-
Decrease with
k
-
Finish with
f
(dotfiles/leader "tf" '(hydra-text-scale/body :which-key "Font"))