From 33575e43305d6340991d84d0150deedff74436e0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 16 Aug 2020 14:22:47 -0700 Subject: bind repeat to C-z --- .emacs.d/init-spw.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el index eff66529..209681b1 100644 --- a/.emacs.d/init-spw.el +++ b/.emacs.d/init-spw.el @@ -287,7 +287,9 @@ add places the library might be available to `load-path'." ;; popping fewer than four times, it's more keystrokes. I'm not sure ;; how distracting it is going to be to have to remember to do that, and ;; how often I want to re-set the mark right after popping to it, so - ;; turning this on experimentally + ;; turning this on experimentally. + ;; + ;; Hmm, with `repeat' easily accessible on C-z, might not need this. set-mark-command-repeat-pop t) (defun spw/remap-mark-command (command &optional map) "Remap a mark-* command to temporarily activate Transient Mark mode." @@ -368,7 +370,9 @@ add places the library might be available to `load-path'." ;; ... and resettle the previous occupant of C-w ;; (we want to use a key which is already globally bound so that we know it is -;; likely to still be available in other major modes) +;; likely to still be available in other major modes, and this has to be a key +;; which can also be bound in .inputrc (so C-z is out as that is used for +;; shell job control)) (global-set-key "\M-z" #'kill-region) ;; ... and resettle the previous occupant of M-z @@ -392,15 +396,19 @@ add places the library might be available to `load-path'." (global-set-key "\M-/" #'hippie-expand) ;; In an emacsclient frame, or a buffer spawned by an eshell process calling -;; emacsclient, this is like 'ZZ' in vi. Since `suspend-frame' is bound -;; to both C-z and C-x C-z, we might bind this to C-z, but that's a standard -;; UNIX shell binding so I might come to regret it +;; emacsclient, this is like 'ZZ' in vi. (defun spw/save-buffers-kill-emacsclient-noconfirm () (interactive) (save-buffer) (server-edit)) (global-set-key "\C-cz" #'spw/save-buffers-kill-emacsclient-noconfirm) +;; Not sure about this: although `suspend-frame' is bound to both C-x C-z and +;; C-z, C-z is a standard UNIX shell binding, so it might not be best to +;; rebind it. On the other hand I hardly ever make use of shell job control +;; with Emacs, since if I have Emacs, then I have Eshell. +(global-set-key "\C-z" #'repeat) + (setq display-buffer-alist ;; This is meant to say: for these buffers which, unusually, do not ;; benefit from being as tall as possible, always display them in the -- cgit v1.2.3