Support font-increase & font-decrease fns

Support functions for increasing and decreasing Emacs's font size --
without requiring a full restart.
This commit is contained in:
William Carroll 2018-06-19 17:14:55 -04:00
parent 0e73a0e77f
commit 014b530037

View file

@ -12,6 +12,26 @@
;; change font ;; change font
(add-to-list 'default-frame-alist '(font . "Operator Mono-10")) (add-to-list 'default-frame-alist '(font . "Operator Mono-10"))
(defconst wpc/font-size-step 10
"The amount (%) by which to increase or decrease a font.")
(defun wpc/increase-font ()
"Increase font size."
(interactive)
(->> (face-attribute 'default :height)
(+ wpc/font-size-step)
(set-face-attribute 'default (selected-frame) :height)))
(defun wpc/decrease-font ()
"Decrease font size."
(interactive)
(->> (face-attribute 'default :height)
(+ (- wpc/font-size-step))
(set-face-attribute 'default (selected-frame) :height)))
(general-def "s-j" #'wpc/decrease-font)
(general-def "s-k" #'wpc/increase-font)
;; smooth scrolling settings ;; smooth scrolling settings
(setq scroll-step 1 (setq scroll-step 1
scroll-conservatively 10000) scroll-conservatively 10000)