I have a pair of bash functions like this

function ff() { find . -path -o -name $@ -print; }
function fvim() { ff "$@" -exec vim {} \;; }

Which is helpful for finding a file and opening it right away in vim. What I'd like to do is either extend this or create a similar function, which I can call from within vim (searching from my active directory, probably just using 'ff') to open the found file in a new buffer of that vim instance, can anyone help with this?


With Vim alone:

:set path=.,,**
:find foo.txt

The filename can't contain wildcards, but :find does have TAB completion.

Alternatively there are many excellent plugins that can do that and a lot more, f.i. Unite, CtrlP, or fzf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.