tags:

views:

39

answers:

1

When omni-completion (or other things) opens the preview window, the size of the main window is reduced in order to make room for the preview window.

By default, the first line that was visible in the main window before the preview window pops up will also be the same after the preview window pops up. This has the unfortunate effect that the text in the main window is pushed down visually.

I would prefer if the text in the main window would stay where it is. This would effectively mean that the first visible line in the main window would need to change when the preview window pops up and closes.

Does anyone know a nice way to accomplish this?

A: 

I don't know how to trigger this, but use : :normal! Hmx`` to save current window position, and :normal! `xzt`` to restore it.

Benoit