From 95f5f73b6f2ce404534c41fd47e791c6b18ca6bd Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Fri, 10 Nov 2023 16:45:56 +0100 Subject: [PATCH] emacs: Set font to Monaspace --- home-manager/modules/emacs/config.org | 60 +++++++++++++++++---------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/home-manager/modules/emacs/config.org b/home-manager/modules/emacs/config.org index af1cb85..09173f3 100644 --- a/home-manager/modules/emacs/config.org +++ b/home-manager/modules/emacs/config.org @@ -55,8 +55,9 @@ Setting =lexical-binding= to =t= can improve startup time. This has to be first! This sets some variables with my personal preferences for easy customization #+begin_src emacs-lisp - (defvar my/default-font "Iosevka Nerd Font") - (defvar my/variable-width-font "Iosevka Aile") + (defvar my/default-font "Monaspace Argon-16") + (defvar my/variable-width-font "Iosevka Aile-16") + (defvar my/comment-font "Monaspace Radon-16") (defvar my/default-font-height 13) (defvar my/default-font-weight 'normal) (defvar my/default-font-width 'normal) @@ -101,7 +102,7 @@ LSP responses can be rather large, in the 800KiB - 3MiB range. 2MiB is a decent ** Package sources -Add repositories where packages are installed from. +Add repositories where packages are installed from. #+begin_src emacs-lisp (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") @@ -419,22 +420,19 @@ I prefer the [[https://draculatheme.com][dracula theme]] (load-theme 'monokai-pro t)) #+end_src -Use Iosevka as font. +Set fonts. #+begin_src emacs-lisp - (add-to-list 'default-frame-alist `(font . ,(format "%s-%d:weight=%s:width=%s" - my/default-font - my/default-font-height - my/default-font-weight - my/default-font-width))) -#+end_src - -#+begin_src emacs-lisp - (set-face-attribute 'variable-pitch nil - :family my/variable-width-font - :weight my/default-font-weight - :width my/default-font-width - :height my/variable-width-font-height) + (defun my/setup-fonts () + ; Monospace + (set-face-attribute 'default nil :font my/default-font) + (set-face-attribute 'font-lock-comment-face nil :font my/comment-font) + ; Variable pitch + (set-face-attribute 'variable-pitch nil + :font my/variable-width-font + :height my/variable-width-font-height)) + (add-hook 'after-init-hook 'my/setup-fonts) + (add-hook 'server-after-make-frame-hook 'my/setup-fonts) #+end_src Emoji support @@ -459,10 +457,30 @@ Enable ligatures (use-package ligature :config ;; Enable all Iosevka ligatures in programming modes - (ligature-set-ligatures 'prog-mode '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "" "--->" "<->" "<-->" "<--->" "<---->" "" "<~" "<~~" "~>" "~~>" "<~>" + ; ss04 + "" "" "/\\" "\\/" + ; ss05 + "|>" "<|" + ; ss06 + "##" "###" + ; ss07 + "***" "/*" "*/" "/*/" "(*" "*)" "(*)" + ; ss08 + ".=" ".-" "..<" + ; dlig & calt + "" ":<" "!!" ">:" "<:" "#=" "?:" "?." "??" ";;" "///" ":::" "..." "=!=" "=:=" "..=" "..-")) ;; Enables ligature checks globally in all buffers. You can also do it ;; per mode with `ligature-mode'. (global-ligature-mode t))