I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

3.8 KiB

Fonts

Unified system font across Emacs.

Setup

Install the required firacode1 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 firacode1 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-icons2 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-dired3 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-emojify4 package. Have we finally gone too far?

(use-package emojify
  :when (window-system)
  :hook (after-init . global-emojify-mode))

Symbols

Programming buffers can be made prettier with pretty-mode5, this is complimentary to prettify-symbols-mode6, a built-in package containing similar (but lacking) functionality.

(use-package pretty-mode
  :hook (python-mode . turn-on-pretty-mode))

Ligatures

Enable firacode1 font ligatures with the fira-code-mode7 package. Only perform this action when firacode1 is the current font, and Emacs isn't running on the TTY.

(use-package fira-code-mode
  :when (and (window-system)
             (equal dotfiles/font "Fira Code"))
  :hook (prog-mode org-mode))

Parenthesis

Colourize nested parenthesis with rainbow-delimeters4, 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"))

Footnotes