]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new C-x w prefix map
authorSean Whitton <spwhitton@spwhitton.name>
Mon, 12 Sep 2022 14:30:07 +0000 (07:30 -0700)
committerSean Whitton <spwhitton@spwhitton.name>
Mon, 12 Sep 2022 14:34:13 +0000 (07:34 -0700)
* window.el (window-prefix-map): New map.
(ctl-x-map): Unbind split-root-window-below and
split-root-window-right.  Bind window-prefix-map to C-x w.

lisp/window.el

index 67a4a4bbf2fa7ce6ae5e2505b09476cc2dc11d6a..d5f42dd10b47c4bda4ae89b250a1aa973df0fe7e 100644 (file)
@@ -10558,8 +10558,6 @@ displaying that processes's buffer."
 (define-key ctl-x-map "{" 'shrink-window-horizontally)
 (define-key ctl-x-map "-" 'shrink-window-if-larger-than-buffer)
 (define-key ctl-x-map "+" 'balance-windows)
-(define-key ctl-x-map "7" 'split-root-window-below)
-(define-key ctl-x-map "9" 'split-root-window-right)
 (define-key ctl-x-4-map "0" 'kill-buffer-and-window)
 (define-key ctl-x-4-map "1" 'same-window-prefix)
 (define-key ctl-x-4-map "4" 'other-window-prefix)
@@ -10590,6 +10588,16 @@ displaying that processes's buffer."
 (put 'shrink-window-horizontally 'repeat-map 'resize-window-repeat-map)
 (put 'shrink-window 'repeat-map 'resize-window-repeat-map)
 
+(defvar-keymap window-prefix-map
+  :doc "Keymap for subcommands of \\`C-x w'."
+  "2" #'split-root-window-below
+  "3" #'split-root-window-right
+  "s" #'window-toggle-side-windows
+  "f" #'tear-off-window
+  "-" #'fit-window-to-buffer
+  "0" #'delete-windows-on)
+(define-key ctl-x-map "w" window-prefix-map)
+
 (provide 'window)
 
 ;;; window.el ends here