Sometimes, after I select a suggestion (from the completion pop-up that appears when pressing Ctrl-N) using the Enter key, Vim will insert a newline and the cursor will be moved to the following line. This doesn't always happen - it seems that Vim tries to be smart about it and will only move me to the next line if it thinks this is what I would like.
However, I want to disable this behavior (because it is not always smart) so that I will always have to move to the next line by myself by manually pressing the Enter key. Is this possible?
Answer
What Vim does in response to your typing the
:help ins-completion-menu
and the behavior of various keys when using insert completion is described in the next section,
:help popupmenu-keys
where it explains that the behavior of the
The best way to avoid inserting a newline when you don't want one is to terminate or make a selection using some other key such as Ctrl-Y or Ctrl-E.
See also
:help complete_CTRL-Y
and for the entire description if insert-mode completion,
:help ins-completion
No comments:
Post a Comment