How do I move my cursor into the preview window to interact with its contents?
Answer
<C-w>P
Explanation
The preview window is a special auxiliary split — usually at the top — opened by commands like :ptag, :pedit, and omni-completion to display reference information. <C-w>P (capital P) moves your cursor directly into that window so you can scroll, search, or copy its contents without closing it.
How it works
<C-w>Pjumps focus to the preview window; fails silently if no preview window is open- Once inside, all normal motions and commands work as usual
<C-w>por<C-w>wreturns to your previous window:pcloseor<C-w>zcloses the preview window from any window
Example
Open a file for reference, then navigate into it:
" Open ~/.vimrc in the preview window
:pedit ~/.vimrc
" Jump into the preview to scroll or yank
<C-w>P
" Return to the original buffer
<C-w>p
" Close the preview when done
:pclose
During omni-completion (<C-x><C-o>), some setups open a preview pane with documentation. Use <C-w>P to scroll that documentation without aborting completion.
Tips
set previewheight=12controls the height of the preview windowset completeopt+=previewenables the preview during completion;set completeopt+=noinsertpairs well with it- The preview window always has
&previewwindowset to 1 — useful in scripts that need to detect it - Only one preview window can exist at a time; opening a new one closes the old one