From 9562511508e06fdeb4365ff60db4ee09949b883e Mon Sep 17 00:00:00 2001 From: noa@gaiwan.org Date: Sat, 15 Jun 2024 17:17:16 +0000 Subject: Rebind window creation commands to switch to the new window --- emacs/init.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'emacs') diff --git a/emacs/init.el b/emacs/init.el index 9f992c7..827a640 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -878,6 +878,19 @@ The misspelled word is taken from OVERLAY. WORD is the corrected word." (global-set-key [remap query-replace-regexp] 'anzu-query-replace-regexp) +;; Switch to new window on creation +(defun noa/split-and-follow-horizontally () + (interactive) + (split-window-below) + (other-window 1)) +(global-set-key (kbd "C-x 2") 'noa/split-and-follow-horizontally) + +(defun noa/split-and-follow-vertically () + (interactive) + (split-window-right) + (other-window 1)) +(global-set-key (kbd "C-x 3") 'noa/split-and-follow-vertically) + (setopt shell-file-name "/bin/sh") (defun snarf-song (url) -- cgit 1.4.1-2-gfad0