On Sat, Dec 26, 2015 at 10:14 PM, Gary Johnson <[email protected]> wrote: > On 2015-12-26, Tony Mechelynck wrote: >> On Sat, Dec 26, 2015 at 5:11 PM, Julien Pivard wrote: >> > >> > I started Vim start with vim -u NONE (to be sure it's a bug, and >> > not caused by my config) and set nocompatible, set wildmenu >> > >> > When press tab after typed :!/ suggestion are duplicate like this : >> > >> > and this : >> > >> > But no probleme in insert mode with <CTRL-X><CTRL-F> >> > >> >> I confirm the duplication. Here on Vim for Linux64, I see the >> following on the wildmenu line: >> >> :/<Tab> >> bin/ boot/ dev/ etc/ home/ lib/ lib64/ lost+found/ mnt/ opt/ proc/ >> root/ run/ sbin/ selinux/ srv/ sys/ tmp/ usr/ var/ bin/ boot/ dev/ >> etc/ home/ lib/ lib64/ lost+found/ mnt/ opt/ proc/ root/ run/ sbin/ >> selinux/ srv/ sys/ tmp/ usr/ var/ >> >> The default 'wildmode' in 'nocompatible' mode is full. >> >> With my usual vimrc which sets 'wildmode' to longest:full,full I see the >> same. >> >> In another case I see only partial duplication: >> >> :!sea<Tab> >> seamonkey seahorse seahorse-demon seahorse-tool seahorse >> seahorse-demon seahorse-tool >> >> while in another case I even see triplication: >> :!fir<Tab> >> firefox firefox firefox >> >> I think I have the explanation: >> >> On this system, most programs live in /usr/bin for which /usr/bin/X11 >> is a symlink; both of these directories are in the $PATH. >> SeaMonkey is installed only in /usr/local/bin which is not duplicated >> in the $PATH >> For Firefox I have both the Mozilla Nightly version in /usr/local/bin >> and the openSUSE Leap version in /usr/bin >> >> IOW, Vim does completion for the :! command by means of the $PATH and >> if a single program name exists at several different places in the >> $PATH it is listed as many times as it is found. >> >> I think it's normal. > > I don't think PATH or symlinks have anything to do with it. The > behavior certainly doesn't seem normal. Using Vim 7.4.942 on Fedora > 14: > > $ PATH= /usr/local/bin/vim -N -u NONE -c 'set wildmode=list' > :!/<Tab> > bin/ lib64/ selinux/ boot/ lost+found/ srv/ > boot/ lost+found/ srv/ cgroup/ media/ sys/ > cgroup/ media/ sys/ data/ mnt/ tmp/ > data/ mnt/ tmp/ dev/ opt/ usr/ > dev/ opt/ usr/ etc/ proc/ var/ > etc/ proc/ var/ home/ root/ win/ > home/ root/ win/ lib/ sbin/ > lib/ sbin/ bin/ lib64/ selinux/ > :!/ > > None of those directories are symlinks. > > Regards, > Gary
The symlinks I talked about weren't for the directories (or files, as the case may be) _returned_ by the :! autocomplete but in the $PATH directories _used_ by it. On my system and with my pesent login name, "echo $PATH" at a shell prompt returns /sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games ls -ld for each of them shows that most are "ordinary" directories; but #ls -ld /usr/bin/X11 lrwxrwxrwx 1 root root 1 Nov 7 10:32 /usr/bin/X11 -> . IOW, /usr/bin/X11 (which is in the $PATH) is a symlink to /usr/bin (which is also in the $PATH). Compare this with the following: 1) at the bash prompt # type -a firefox firefox is /usr/local/bin/firefox firefox is /usr/bin/firefox firefox is /usr/bin/X11/firefox The latter two refer to the same binary, but in one case with a symlink in its path; the first one is different. Now in Vim: :!fir<Tab> firefox firefox firefox For sea<Tab> I get 4 results, one of which (seamonkey) is not in /usr/bin aka /usr/bin/X11: that one appears once, the other three appear twice. For :!/ type (or which) return "not found" and exit with status 1 so Vim tries to complete in a different manner. I'm not sure how it finds its results in this case. Best regards, Tony. -- -- You received this message from the "vim_dev" 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
