about summary refs log tree commit diff
path: root/tools/emacs/config/bindings.el
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-17T17·30+0000
committerVincent Ambo <mail@tazj.in>2019-12-17T17·48+0000
commitbe28071e56fb3aab5336eccb71e4627a9005bfce (patch)
tree55e004ce13cb63f7a002e4c83d05a7c3e9ee8788 /tools/emacs/config/bindings.el
parentcaf23a9e2a6c0ad67058f469ec7cd4e5be0694a6 (diff)
feat(emacs.d): Add functions & bindings to manage global font size r/178
This makes it possible to quickly adjust the size of text in all
frames using one keyboard shortcut. Each of these functions
understands a prefix argument to mean "please only operate on the
current buffer", hence the following bindings and effects:

Global:
* `C-=`: Increase the global font size (chosen because `+` lies on the
  `=` key)
* `C--`: Decrease the global font size
* `C-x C-0`: Restore the global default font size

Local:
* `C-u C-=`: Increase the local font size
* `C-u C--`: Decrease the local font size
* `C-u C-x C-0`: Restore the local default font size
Diffstat (limited to 'tools/emacs/config/bindings.el')
-rw-r--r--tools/emacs/config/bindings.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/emacs/config/bindings.el b/tools/emacs/config/bindings.el
index a45c8d4707..e77af33895 100644
--- a/tools/emacs/config/bindings.el
+++ b/tools/emacs/config/bindings.el
@@ -1,6 +1,7 @@
 ;; Font size
-(define-key global-map (kbd "C-+") 'text-scale-increase)
-(define-key global-map (kbd "C--") 'text-scale-decrease)
+(define-key global-map (kbd "C-=") 'increase-default-text-scale) ;; '=' because there lies '+'
+(define-key global-map (kbd "C--") 'decrease-default-text-scale)
+(define-key global-map (kbd "C-x C-0") 'set-default-text-scale)
 
 ;; What does <tab> do? Well, it depends ...
 (define-key prog-mode-map (kbd "<tab>") #'company-indent-or-complete-common)