Fan Decheng wrote:
Only recently did I read the vim manual for command line completion. In
the documentation, I found that the following is a handy way to open a
file when using the :e command.

1. Type :e followed with a space.
2. Type the first a few characters of the file you want to edit.
3. Press CTRL-L. Vim will do completion like most UNIX shells do.
4. Type more characters if the file name is not expected.
5. Repeat step 3 to 4 until the file name is complete.
Note: After pressing CTRL-L, if you still cannot remember the rest part
of the file name, press CTRL-D to list all possible names. This works
like the Bourne Again Shell.

Happy Vimming!







If you have 'wildmenu' on, you can do the same with Tab instead of Ctrl-L, and get a menu of possible completions on the bottom status line. Use the left and right arrow keys to cycle through the possible completions and what you initially typed, down-arrow to "descend" into a subdirectory, add some more letters and tab again for a narrower choice, Enter to accept, Esc to abort, etc. To complete the longest common match in addition to this "menu" behaviour, use ":set wildmenu wildmode=longest:full".

see
        :help 'wildmenu'
        :help 'wildmode'


Best regards,
Tony.

Reply via email to