Improve window placement for shell windows

Allow splitting windows vertically when height is a bit lower (as is on my machine), so that shell
buffers can appear also in a smaller windows.  Also reuse windows that already display a shell
buffer to be able to jump to them (and avoid duplicate windows).
This commit is contained in:
Daniel Borchmann 2025-06-01 09:51:11 +02:00
parent 573b275972
commit e41e62d6dc
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

View File

@ -355,7 +355,9 @@
:init (setq switch-to-buffer-obey-display-actions t
switch-to-buffer-in-dedicated-window 'pop
recenter-positions '(top middle bottom)
display-buffer-base-action '(display-buffer-reuse-window))
display-buffer-base-action '(display-buffer-reuse-window)
split-height-threshold 50
split-width-threshold 140)
:config (progn
(add-to-list 'display-buffer-alist
'("^\\*Async Shell Command*"
@ -392,7 +394,8 @@
(add-to-list 'display-buffer-alist
'("shell\\*"
(display-buffer-pop-up-window)))))
(display-buffer-reuse-window
display-buffer-pop-up-window)))))
(use-package which-key
:ensure t