Yegappan Lakshmanan Sent April 20, 2006 
  
  > 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.
  
  Here's a reason why it should:

      Note that <C-D> is not only for file-name completion -- it 
      is for command-line completion.  It is defined as "List 
      names that match the pattern in front of the cursor."
      So since :find uses 'path', shouldn't <C-D> acting as
      command-line completion use 'path' for completing 
      :find <partial><C-D>?  

  > 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>

  --Suresh

Reply via email to