Question

I'm trying the Vim plugin Jedi-vim and it would open a preview-window while doing autocomplete and close when it's done. This may cause the cursor and the code to jump in term of the location in the physical LCD screen and it makes my eye uncomfortable. I have the option of leaving this window open, however I prefer to have a bigger screen estate. Is there a way to move the preview-window else where like maybe on the bottom, or use vertical split instead?

Was it helpful?

Solution

The only thing that distinguishes the preview window from other windows is the 'previewwindow' option. You can turn any window into the preview window via :setlocal previewwindow, or influence the position of it via e.g. :botright vertical pedit.

When Vim opens the preview window, it is positioned above the current window. So, you either need to manually open it before attempting the completion, or completely turn off this behavior via :set completeopt-=preview.

OTHER TIPS

Try something like this:

augroup PreviewOnBottom
    autocmd InsertEnter * set splitbelow
    autocmd InsertLeave * set splitbelow!
augroup END

If you are using gVim you can,

  1. Select the Preview Window in Normal mode
  2. Click on Window menu in the toolbar >> Move To >> Right Side

I know using a mouse is a "non-VIM" way of doing it, but it works, and is easy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top