I use two vim plugins that heavily rely on preview window (one for version control and one for user completion). I also often work with vertical split and some of the time it is in diff mode. Now when the preview window comes up in such state, it will only split off the current column looking ugly and breaking the synchronization if I am in diff mode. Is there some way to make preview window always open :topleft without affecting normal splits?


Unfortunately, there isn't. You either have to modify the plugin(s), prepending :topleft to the existing :pedit command, or you can try defining an autocmd to move a window if it is a preview one. Here is a sketch (that only triggers when the preview window is entered; you may need to add other events to it):

:autocmd WinEnter * if &previewwindow && winnr() > 1 | wincmd K | endif
| improve this answer | |
  • I think it will be enough if I bind something along the lines to some key to fix the window up when I need to. Thanks. – Jan Hudec Oct 21 '13 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.