mini-ontop is a small Emacs package that prevents the “jump” or recentering of the main editing window whenever a multi-line minibuffer (for instance from icomplete-vertical-mode) is triggered. By automatically adjusting point just enough before showing the minibuffer, Emacs won’t force the screen to scroll.
This solves a common annoyance where pressing M-x
or any other command that
opens a multi-line minibuffer can cause your main window to jump up a few lines
or flicker.
No special configuration is required—just enable mini-ontop-mode
and enjoy
a calmer editing experience.
(use-package mini-ontop
:ensure t
:config (mini-ontop-mode 1))
• mini-ontop-lines: By default, mini-ontop-lines
attempts to compute a reasonable
estimate based on Emacs’ max-mini-window-height
. However, your
setup might need fine-tuning. If you still see jumps/flicker, try
increasing mini-ontop-lines
.
• mini-ontop-ignore-predicates: A list of zero-argument functions (predicates).
If any of these functions returns non-nil, mini-ontop will skip moving the
point up for that particular window/buffer combination. This is useful for
ignoring certain modes or commands (e.g., if you want to disable the behavior
while using ivy-yasnippet or other special minibuffer-driven workflows).
Example usage:
(add-to-list ’mini-ontop-ignore-predicates (lambda () (bound-and-true-p ivy-yasnippet–active)))
These two options give you the flexibility to fine-tune mini-ontop so that it “just works” in your environment, while still respecting any special cases.
- Fork the repository on GitHub.
- Create a feature branch for your changes.
- Open a Pull Request describing your modifications or improvements.
Bugs, suggestions, and other feedback are welcome via the GitHub issue tracker.
mini-ontop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
mini-ontop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Emacs. If not, see https://www.gnu.org/licenses/.