Word Completion (Ctrl-N / Ctrl-P)
Type a few letters; let Vim finish the word.
Ctrl-N and Ctrl-P trigger keyword completion from the current and other buffers. Once a menu is up, Ctrl-N/Ctrl-P walk the suggestions; Ctrl-E cancels; Ctrl-Y accepts.
Word Completion
Type a partial word, then Ctrl-N (next) or Ctrl-P (previous) to autocomplete from words already in scope. Vim has had this since the mid-90s β long before IDE autocomplete was standard.
| Key | Note |
|---|---|
| tex | Start typing⦠|
| {key:Ctrl-N} | Pop the completion menu |
| {key:Ctrl-N} | Cycle forward through matches |
| {key:Ctrl-P} | Cycle back |
| {key:Ctrl-Y} | Accept the highlighted match |
| {key:Ctrl-E} | Cancel β keep what you typed |
Worked example β Ctrl-N
Word completion from buffer.
Ctrl-N searches forward through known words; Ctrl-P backward. Ctrl-X opens the sub-completion menu (filenames, lines, etc.).
Watch
See also: The Ctrl-X Sub-Completions