too-wide-minibuffer-mode adjusts minibuffer size and position, so it is displayed under the selected window and occupied half of the frame. It is move convenient to focus if the frame is too wide.
The package is available from
MELPA. After installation, activate the
global minor mode with M-x too-wide-minibuffer-mode RET.
(use-package too-wide-minibuffer-mode
:init
(too-wide-minibuffer-mode +1)
:custom
;; The maximum allowed width for minibuffer window to display as is.
(too-wide-minibuffer-max-width 200)
;; The mode is not compatible with `minibuffer-follows-selected-frame` set to `t`
(minibuffer-follows-selected-frame nil))This mode doesn’t work properly if `minibuffer-follows-selected-frame` is set to `t` and there are more than one frame. Please disable this setting in your configuration to avoid a warning message.
Apparently, this problem was solved one way or another many times in Emacs community. Here are the list of alternatives with a few words about the differences:
- vertico-posframe works great, but only if you use vertico package and only to show completion candidates. It means it doesn’t control where Emacs shows `I-search:` prompt for example
- emacs-mini-frame again, doesn’t control the echo area, also moves the minibuffer to a separate frame which creates problems with window managements
- emacs-maple-minibuffer wraps around Emacs any command and should work with `isearch-forward` and `query-replace`, but in practice these commands don’t always use standard minibuffer interactions and at least for me neither isearch nor query-replace work reliably
- ivy-posframe the same as vertico-posframe, great for completion candidates when you use `ivy`, but doesn’t affect isearch, echo area messages and etc
