On Tue, 9 May 2006, Benjamin Reitzammer wrote:
[snip]
Regarding :find. It does not do &path-full completion, and
no 'incremental completion menu'. To write such plugin, you'd
need to process every typed character.
Yes I tried, :find and that it's not doing completion of my filename,
is something that makes it a lot less useful. Sure it broadened my vim
skills ;) but it's still not as good as the described solution the
jedit plugin offers.
[snip]
This has been suggested in the list before (by Hari, I think). Put these
lines in your vimrc:
==
command! -nargs=? -complete=custom,PathFileComplete -bang -bar Find find<bang>
<args>
function! PathFileComplete(ArgLead, CmdLine, CursorPos)
return substitute(globpath(&path, a:ArgLead."*"), "[^\n]\\+/", "", "g")
endfunction
set wildmenu wildmode=longest:full
==
Then instead of doing
:find <partial filename>
do
:Find <partial filename>
(notice the capital "F")
Completion will work now. :Find is :find with completion.
Take note of what J??rgen & Tim had to say. :Find will look in the
directories specified in the option 'path', as J??rgen mentioned.
After typing your <partial filename>, you can hit the <Tab> button, as
Tim mentioned, to complete the filename and/or bring up the wildmenu so
you can scroll through the matching filenames from left to right. You
can also type Ctrl-d to list the matching filenames.
HTH :)
--
Gerald