On 09/02/09 08:52, Per Thulin wrote:
> Hi,
>
> when searching for a file and using tab, I'd like the tab completion
> to work like in bash, e.g. you see a table of files matching what you
> have typed. Problem now is that the first filename suggested gets
> inserted instead of only the few letters I'd typed. This leads to me
> often typing a few letters, pressing tab, and then having to backspace
> a lot of stuff away...

With 'wildmenu' on, typing <Left> on the first wildmenu entry brings you 
back to what you typed; but see more below.

>
> I know about wildmenu and use it today, but it doesn't give me what
> I'm after:
>
> (1) Table like display of files... like in bash
> (2) More careful suggestion of filenames so that I don't have to
> backspace... like in bash
>
> Thanks in advance!
> -Per

To see all possible completions, use Ctrl-D instead of Tab: this way, 
you can still use completion-by-menu (with 'wildmenu' on) when you feel 
like it.

Bash (the way it's configured on my system) only gives a list when 
there's no common part anyway; otherwise it completes the longest common 
part and waits. Hitting <Tab> again (now that the common part has been 
completed) gives a list. If there's only one completion bash follows it 
with a space.

You can get similar behaviour in Vim with 'wildmenu' on by setting 
wildmode=longest:full,full -- in that case, when there is no common part 
to all completions, the menu will appear with the first item highlighted 
but nothing will be filled-in. Hit <Right> to fill in the first 
completion, then <Right> again, or <Left>, to cycle over all possible 
completions and the exact text you typed. As always, <Enter> accepts, 
<Esc> cancels, <Down> navigates into a subdirectory (when completing 
filenames) or a submenu (with :emenu), <Up> comes back after going down.


Best regards,
Tony.
-- 
You should tip the waiter $10, minus $2 if he tells you his name,
another $2 if he claims it will be His Pleasure to serve you and
another $2 for each "special" he describes involving confusing terms
such as "shallots," and $4 if the menu contains the word "fixin's."  In
many restaurants, this means the waiter will actually owe you money.
If you are traveling with a child  aged six months to three years, you
should leave an additional amount equal to twice the bill to compensate
for the fact that they will have to take the banquette out and burn it
because the cracks are wedged solid with gobbets made of partially
chewed former restaurant rolls saturated with baby spit.

In New York, tip the taxicab driver $40 if he does not mention his
hemorrhoids.
                -- Dave Barry, "The Stuff of Etiquette"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to