In Vim, you can use
C-n to complete a word found elsewhere in the buffer (or in a different buffer). If you then hit
C-x C-n it will insert the following word, and you can continue in this manner to complete a series of words one at a time.
I’ve gotten a lot of mileage out of that, and was hoping Evil/Emacs might have something similar. It does!
In Evil, instead of tapping
C-x between each
C-n, you tap
SPC between each
For example, in a buffer like,
a█ foobar abc def ghi
C-n to produce,
abc█ foobar abc def ghi
SPC C-n to produce,
abc def█ foobar abc def ghi
abc def ghi█ foobar abc def ghi
I stumbled across this while reading through the source of
If the user inserts a space after expanding and then asks to expand again, always fetch the next word.
Vim also provides similar functionality around full line completion, i.e.
C-x C-l to complete a whole line, then
C-x C-l to complete the following line, etc. I don’t yet know if something similar exists in Evil/Emacs/dabbrev/etc.