aboutsummaryrefslogtreecommitdiffstats
path: root/oni-core.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-05-24 23:52:39 -0700
committerGravatar Tom Willemse2023-05-24 23:54:50 -0700
commitdf67fdad8b73ac9077659a0d6f83bf4705221502 (patch)
tree893adc7e18e1ae849f87ff9dee4af2425715bfba /oni-core.el
parent020f19fcbc9b197f2355de463f781868fa31ebde (diff)
downloademacs-config-df67fdad8b73ac9077659a0d6f83bf4705221502.tar.gz
emacs-config-df67fdad8b73ac9077659a0d6f83bf4705221502.zip
[oni-core] Add window management keybindings
The various ‘M-<NUMBER>’ keybindings are all also bound to ‘C-<NUMBER>’, no need to have both, and using ‘M-0’ is a lot easier than using ‘C-x 0’. This also replaces the old keybindings with a message that tells me to use the new keybindings instead to help me learn.
Diffstat (limited to 'oni-core.el')
-rw-r--r--oni-core.el19
1 files changed, 18 insertions, 1 deletions
diff --git a/oni-core.el b/oni-core.el
index cdc1a61..38f16c1 100644
--- a/oni-core.el
+++ b/oni-core.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2023.0416.003045
+;; Version: 2023.0509.234254
;; Package-Requires: (oni-data-dir oni-embrace oni-hydra expand-region multiple-cursors gcmh diminish ws-butler which-key insert-char-preview mixed-pitch ace-window vertico marginalia orderless consult embark docstr mini-frame)
;; This program is free software; you can redistribute it and/or modify
@@ -415,6 +415,23 @@ _s_: String list"
(global-set-key [remap switch-to-buffer] 'consult-buffer)
(global-set-key [remap yank-pop] 'consult-yank-pop)
+(global-set-key (kbd "M-0") #'delete-window)
+(global-set-key (kbd "C-x 0") (lambda () (interactive) (error "Use M-0 instead")))
+(global-set-key (kbd "M-1") #'delete-other-windows)
+(global-set-key (kbd "C-x 1") (lambda () (interactive) (error "Use M-1 instead")))
+(global-set-key (kbd "M-2") #'split-window-below)
+(global-set-key (kbd "C-x 2") (lambda () (interactive) (error "Use M-2 instead")))
+(global-set-key (kbd "M-3") #'split-window-right)
+(global-set-key (kbd "C-x 3") (lambda () (interactive) (error "Use M-3 instead")))
+(global-set-key (kbd "M-4") #'ctl-x-4-prefix)
+(global-set-key (kbd "C-x 4") (lambda () (interactive) (error "Use M-4 instead")))
+(global-set-key (kbd "M-5") #'ctl-x-5-prefix)
+(global-set-key (kbd "C-x 5") (lambda () (interactive) (error "Use M-5 instead")))
+(global-set-key (kbd "M-6") #'2C-command)
+(global-set-key (kbd "C-x 6") (lambda () (interactive) (error "Use M-6 instead")))
+(global-set-key (kbd "M-8") (keymap-lookup global-map "C-x 8"))
+(global-set-key (kbd "C-x 8") (lambda () (interactive) (error "Use M-8 instead")))
+
(defun oni-core-related-files ()
"Return a list of files related to the current buffer."
(let* ((jumpers related-files-jumpers)