feat(emacs): add priime-font
commands for frame-wide font manipulation
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
75c85d308c
commit
8ee47be849
1 changed files with 28 additions and 3 deletions
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
;;; Font
|
;;; Font
|
||||||
(defvar priime--font-config
|
(defvar priime--font-config
|
||||||
(cond ((string= (system-name) "framework") '("Roboto Mono Medium" "Roboto" 10 0.8))
|
(cond ((string= (system-name) "framework") '("Roboto Mono Medium" "Roboto" 12 0.8))
|
||||||
((eq system-type 'gnu/linux) '("Roboto Mono Medium" "Roboto" 10 0.8))
|
((eq system-type 'gnu/linux) '("Roboto Mono Medium" "Roboto" 12 0.8))
|
||||||
((eq system-type 'darwin) '("Menlo" "Verdana" 12 1))
|
((eq system-type 'darwin) '("Menlo" "Verdana" 12 1))
|
||||||
(t '("Roboto Mono" "Roboto" 10 0.8))))
|
(t '("Roboto Mono" "Roboto" 10 0.8))))
|
||||||
|
|
||||||
|
@ -18,6 +18,27 @@
|
||||||
(defvar priime-font-size (-third-item priime--font-config))
|
(defvar priime-font-size (-third-item priime--font-config))
|
||||||
(defvar priime-fixed-height (-fourth-item priime--font-config))
|
(defvar priime-fixed-height (-fourth-item priime--font-config))
|
||||||
|
|
||||||
|
(defun priime-font-reload ()
|
||||||
|
"Reload the default font."
|
||||||
|
(let ((priime-font-height (* priime-font-size 10)))
|
||||||
|
(set-face-attribute 'default nil
|
||||||
|
:family priime-fixed-font
|
||||||
|
:height priime-font-height
|
||||||
|
:weight 'medium)))
|
||||||
|
|
||||||
|
(defun priime-font+ (amt)
|
||||||
|
"Increases the font size by AMT."
|
||||||
|
(interactive "p")
|
||||||
|
(let ((amt (or amt 1)))
|
||||||
|
(setq priime-font-size (+ amt priime-font-size))
|
||||||
|
(priime-font-reload)))
|
||||||
|
|
||||||
|
(defun priime-font- (amt)
|
||||||
|
"Decreases the font size by AMT."
|
||||||
|
(interactive "p")
|
||||||
|
(let ((amt (or amt 1)))
|
||||||
|
(priime-font+ (- amt))))
|
||||||
|
|
||||||
;;; Keybindings
|
;;; Keybindings
|
||||||
(defun priime-split-right ()
|
(defun priime-split-right ()
|
||||||
"Split the window right and move to it."
|
"Split the window right and move to it."
|
||||||
|
@ -172,7 +193,11 @@
|
||||||
(keymap-global-unset "C-z")
|
(keymap-global-unset "C-z")
|
||||||
(keymap-global-unset "C-x C-z")
|
(keymap-global-unset "C-x C-z")
|
||||||
(keymap-global-unset "C-x f")
|
(keymap-global-unset "C-x f")
|
||||||
(keymap-global-set "C-x f" priime-fill-map))
|
(keymap-global-set "C-x f" priime-fill-map)
|
||||||
|
|
||||||
|
(keymap-global-set "C-+" #'priime-font+)
|
||||||
|
(keymap-global-unset "C--")
|
||||||
|
(keymap-global-set "C--" #'priime-font-))
|
||||||
|
|
||||||
(provide 'priime-general)
|
(provide 'priime-general)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue