Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 714
PlankTon Avatar asked Nov 06 '12 23:11

PlankTon


2 Answers

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

See

:h complete_CTRL-E
:h ins-completion
like image 57
Peter Rincker Avatar answered Oct 06 '22 01:10

Peter Rincker


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

like image 28
RocketDonkey Avatar answered Oct 05 '22 23:10

RocketDonkey