Tip 117Autocomplete Sequences of Words

When we use autocomplete to expand a word, Vim remembers the context from which that word was taken. If we invoke autocomplete a second time, Vim will insert the word that followed the original completion. We can repeat this again and again to fill in entire sequences of words. This can often produce results faster than using copy and paste to duplicate phrases.

Suppose that we’re working on this document:

 Here's the "hyperlink" for the Vim tutor:
 <vimref href=​"http://vimhelp.appspot.com/usr_01.txt.html#tutor"​>tutor</vimref>.
 
 For more information on autocompletion see:
 <vimr

The <vimref> tag is a custom element that I use throughout the XML manuscript for this book ...

Get Practical Vim, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.