From 4b92a5de32af1e17362b3fd11465e9087046787d Mon Sep 17 00:00:00 2001 From: David Florness Date: Sun, 20 Aug 2023 12:45:12 -0400 Subject: [PATCH] keys: use C-c C-s for switching to scratch buffer sometimes the key is unavailable when it serves some OS-defined purpose (e.g. music player on macOS) --- lisp/keys.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/keys.el b/lisp/keys.el index ee1672b..b1e8053 100644 --- a/lisp/keys.el +++ b/lisp/keys.el @@ -123,6 +123,11 @@ (call-interactively 'compile))) (global-set-key (kbd "") #'shell) (global-set-key (kbd "") #'eshell) -(global-set-key (kbd "") (lambda () - (interactive) - (switch-to-buffer "*scratch*"))) + +(defun switch-to-scratch () + "Switch to the *scratch* buffer" + (interactive) + (switch-to-buffer "*scratch*")) + +(global-set-key (kbd "C-c C-s") #'switch-to-scratch) +(global-set-key (kbd "") #'switch-to-scratch) -- 2.38.4