October 2012
346 pages
7h 40m
English
| Tip 115 | 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:
| auto_complete/bg-colors.css | |
| | .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 (Table 31, Duplicating the Second Line at the End of a File).
| Keystrokes | Buffer Contents | ||
|---|---|---|---|
{start} |
|
Read now
Unlock full access