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.
 
 
 

4.0 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))

Scrolling

Emacs' default scrolling behaviour is annoying. The sudden half-page jumps and the variable scroll-speed can be fixed with a few simple commands.

(setq scroll-conservatively 101                    ;; Values >= 100 fix page jumping.
      mouse-wheel-scroll-amount '(3 ((shift) . 3)) ;; Control the number of lines per jump.
      mouse-wheel-progressive-speed t              ;; Accelerate scrolling with the mouse wheel.
      mouse-wheel-follow-mouse t)                  ;; Scroll the window under the mouse.

Ligatures

Enable firacode1 font ligatures with the fira-code-mode5 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