On 09/06/11 01:38, heirloom wrote:
Hi Tony,

The requirement of a "common left-hand part" for<tab>  to be able to
auto-complete words seems too **strict** for me. The reason is that:
when I typed ":b u" and pressed<tab>, it is hoped to SMARTLY
autocomplete the words up to ":b usa"(since this is common part
between 'usa1' and 'usa1'), so then  I just have to continue to type
"1" or "2" to choose "usa1" or "usa2".  But right now in vim, I have
to wholly type  "sa1" or "sa2", which costs more time.

Still waiting for a solution. Thanks.

Did you try to hit <Tab> repeatedly? I did.

With the following settings:
        :set wildmenu wildmode=longest:full,full
and the following directory hierarchy
  $HOME
    +-- test/
          +-- usa1
          +-- test/
                +-- usa2

after doing (in the shell)
        cd ~/test
        vim usa1 test/usa2              

typing
        :b u<Tab>
gives nothing (other than a menu with both filenames on it), but hitting <Tab> a second time gives
        :b usa1
and a third time gives
        :b test/usa2
OTOH, typing
        :b t<Tab>
displays a menu with ~/test/usa1 and test/usa2 (but no change on the command-line), then a second <Tab> gives
        :b ~/test/usa1
and a third <Tab> gives
        :b test/usa2

In either case, the first <Tab> doesn't complete because there is nothing *common* to complete *at the start*. If you did the following
        mkdir test
        cd test
        touch foobar
        touch barfoo
        vim foobar barfoo
(with the files in the same directory), would you expect
        :b f<Tab>
to complete to
:b foo_ (where _ is the cursor)? I wouldn't. Experiment shows that :b f<Tab> completes to :b foobar, that :b b<Tab> completes to :b barfoo, and that :b o<Tab> cycles between
        :b o_
        :b foobar_
        :b barfoo_
with the same "cursor" convention as above. Why doesn't it find both files in the other cases? Simple: One completion is definitely "better" than the other, which is then not considered.

See :help 20.3 for more details.

Conclusion: T'aint a bug, it's a feature.


Best regards,
Tony.
--
In America, any boy may become president and I suppose that's just one
of the risks he takes.
                -- Adlai Stevenson

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to