djv
djv

Reputation: 466

Vim: How to exclude already typed result from CTRL+N autocomplete

I've searched the manual, but really have no idea what I'm looking for. Here's a screenshot of what happens when I'm typing a word and press CTRL+N to autocomplete it:

I obviously do not want to autocomplete the word I just typed as it's already typed, therefore don't need it to show in the results dropdown.

It doesn't show up every time I use CTRL+N, which is odd.

Upvotes: 0

Views: 131

Answers (1)

sidyll
sidyll

Reputation: 59277

The controlN autocompletes with words starting with the keyword at your curson position, starting the search forward (think of N as "next). And in your case, you do have a word right on the same line that is requiredF, which was found by the auto complete.

If your desired keyword is before your cursor, you can use the similar command controlP which does the search backwards, thus searching for the previous possible completion. This is the most common command you will use when you're writing new text, for example.

Upvotes: 3

Related Questions