PlankTon
PlankTon

Reputation: 12605

Vim autocomplete: Cancelling autocomplete popup

If I hit ctrl+n in vim, I'll get a list of suggested autocomplete options in a popup box.

This is fine...but if I decide I don't want to autocomplete after all, I'm not quite sure what to press to revert the suggestion.

For example, suppose I type rea, hit ctrl+n, and autocomplete pops up with really_long_method_name_damn_this_is_annoying...and I don't want that. I can't quite figure out how to revert the syntax back to just rea... I have to manually delete the unwanted characters.

I'm guessing this is a pretty straightforward thing, but still - if anyone knows how, please let me know.

Upvotes: 20

Views: 7053

Answers (4)

Peter Rincker
Peter Rincker

Reputation: 45177

Ctrl+E will end the current completion and put back that originally typed text.

See

:h complete_CTRL-E
:h ins-completion

Upvotes: 48

NPE
NPE

Reputation: 500893

Press Ctrl+P followed by Esc. The former will remove the autocompleted text, and the latter will close the popup.

Upvotes: 1

Matthew Strawbridge
Matthew Strawbridge

Reputation: 20640

Type :help ins-completion-menu for a detailed description of all your options.

Upvotes: 1

RocketDonkey
RocketDonkey

Reputation: 37279

Try pressing Ctrl+P to take you back to the original (or if you are feeling ambitious, Ctrl+N until you loop back around :) ).

Upvotes: 1

Related Questions