Paths and Whole Lines
Ctrl-x opens a submode
Ctrl-x puts Vim into a completion submode with several sources behind it.
Ctrl-x Ctrl-f — real file paths
Type ./ and press Ctrl-x Ctrl-f. Vim reads your actual folders at that moment and offers what is there:
-- File name completion (^F^N^P) match 2 of 13Not a cached index — the real directory. Keep going, add a slash, ask again, and it reads the next folder down. You can walk a whole project without alt-tabbing to check a filename.
Ctrl-x Ctrl-l — a whole line
Type the first few characters of a line that exists elsewhere in the file and press Ctrl-x Ctrl-l. The entire line arrives, exactly as written elsewhere.
This is the one that saves you on repetitive blocks: a list of imports, similar assignments, a table of test cases.
Where the candidates come from
:set complete?| Flag | Source |
|---|---|
. | the file you are in |
w | other windows |
b | other loaded buffers |
u | unloaded buffers |
t | tags |
So a name you typed in a different file twenty minutes ago is still offered here.
And Ctrl-x Ctrl-o
Omni completion — language-aware. In plain Vim it is limited, and it is precisely the thing a language server replaces properly later in the course. But now you know what it is replacing.