Hi Suresh,

On 4/20/06, Suresh Govindachar <[EMAIL PROTECTED]> wrote:
>
> Hello Bram,
>
>   Is the following
>
>        :find <partial><C-D>
>
>   supposed to use 'path'?  For me, it uses
>   the current directory to suggest completions
>   but not the 'path' -- am I doing something wrong?
>

No. The command-line file name completion doesn't search for
file names from the directories set in the 'path' option.

You can use the following function and command:

    function! FindFileFn(ArgLead, CmdLine, CursorPos)
        let pat = a:ArgLead . '*'
        return substitute(globpath(&path, pat), "[^\n]\\+/", '', 'g')
    endfunction

    command! -nargs=1 -bang -complete=custom,FindFileFn
                \ FindFile find<bang> <args>

- Yegappan

Reply via email to