On Thu, 20 Apr 2006 at 7:14pm, Curtis Spencer wrote:

> Hi,
>
>  I am looking for a nice way to open up a file in subdirectory if I know
>  the first few characters of the name, ie.:
>
>  :open hel<press tab>  and then I see :open hello_world.c, if it is
>  somewhere in some subdirectories of the current directory.  Is there a
>  nice way to do this?
>
>

I put the following in my vimrc:

command! -nargs=* -bang -complete=custom,<SID>PathComplete FindInPath
      \ :find<bang> <args>
function! s:PathComplete(ArgLead, CmdLine, CursorPos)
  return UserFileComplete(a:ArgLead, a:CmdLine, a:CursorPos, 1, &path)
endfunction

You need to set 'path' appropriately for this to work. The
UserFileComplete() is a function from genutils.vim, so you need that
plugin, or copy the relevant code from it into your vimrc.

-- 
HTH,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to