October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 116 | Autocomplete Entire Lines |
In all of the examples so far, we’ve looked at completing words, but Vim can also autocomplete entire lines.
Line-wise autocompletion is triggered by running <C-x><C-l> (see compl-whole-lineⓘ). Suppose that we started off with this snippet:
| | .top { |
| | background-color: #ef66ef; } |
| | .bottom { |
We want to duplicate the second line and place it at the end of the file. Here’s how this can be done using whole-line autocompletion:
| Keystrokes | Buffer Contents | ||||||||
|---|---|---|---|---|---|---|---|---|---|
{start} |
| ||||||||
oba |
| ||||||||
<C-x><C-l><Esc> |
|
The same files ...