Using plugin YouCompleteMe, I get useful previews of entries. However, if the cursor is near the end of the line, the list gets out of sight. Screenshots below; the latter with pumwidth=75.

(First image.) Truncated preview list

(Second image.) Pumwidth 75

The only way I've found to get around this, is to resize the window temporarily so that it will be wide enough to show the preview, or move the cursor to the left in the line, as in the screenshot below.

Wider preview list

Is there any way to tell vim, that n characters of preview should always be shown, and if the completion list "disappears outside the window", it should shift it to accommodate n? (n=20 might be a suitable number for me.)

EDIT: Setting pumwidth to really high did the trick; in the figures of 200 or so. Screenshot:pumwidth = 200

1 Answer 1


You can set the 'pumwidth' option to set a minimum width for the pop-up menu.

The setting is for the total width, including the match and the preview, so you want to set it to something higher (like 35 or 40) to ensure you'll have at least 20 characters or so of the preview available.

UPDATE: Setting 'pumwidth' to a really large value, like 200, solved the OP's problem, so that's worth a try!

set pumwidth=200
  • 1
    NOTE: I haven't really checked whether this works with YCM, but the pop-up menu ("pum") is the underlying feature used by it, so it should. Default for 'pumwidth' is 15 and your screenshot shows fewer characters, so not sure what's up with that... Anyways, if this doesn't work for you, let me know. Thanks!
    – filbranden
    Jul 5, 2019 at 13:05
  • Thank you for the suggestion! Indeed, I had found references to pumwidth prior to coming here, and had tried some different settings for it; that might be why there were few characters in one of the screenshots. Anyway, as far as I can tell it has no effect. I've tried : set pumwidth=50 as well as 75, and 150. The edge of the window cuts off the pop-up menu regardless. I'll add a screenshot to the original post for clarification.
    – krissen
    Jul 5, 2019 at 16:04
  • 1
    Seems I hadn't tried setting pumheight large enough! 200 gave me the result I wanted (adding screenshot to original post).
    – krissen
    Jul 6, 2019 at 20:12
  • @krissen Thanks! I also updated the answer to include the information for your comments, so it can potentially help others who get here with the same problem and jump to the answer without seeing your update in the question. Glad that the issue is now solved for you!
    – filbranden
    Jul 7, 2019 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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