emacs: Set font to Monaspace

This commit is contained in:
Erwin Boskma 2023-11-10 16:45:56 +01:00
parent c3c2aa518d
commit 95f5f73b6f
Signed by: erwin
SSH key fingerprint: SHA256:3F6Cm6I3erRqlBwEghZWAQl6eS5WrGTX1Vs/Evec1lQ

View file

@ -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)
@ -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 '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--"
"<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---"
"<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!=="
":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"))
;; (ligature-set-ligatures 'prog-mode '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--"
;; "<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---"
;; "<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!=="
;; ":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"))
;; Ligatures for Monaspace
(ligature-set-ligatures 'prog-mode '(
; ss01
"==" "===" "=/=" "!=" "!==" "/=" "/==" "~~" "=~" "!~"
; ss02
">=" "<="
; ss03
"->" "<-" "=>" "<!--" "-->" "<~" "<~~" "~>" "~~>" "<~>"
; 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))