I'm trying to get gf
working with paths that look like this:
foo/bar.js
The file is located here: /Users/dimal/dev/project/src/foo/bar.js
So I set my path
like this:
set path+=/Users/dimal/dev/project/src
It seems like gf
should find the file but it doesn't.
E447: Can't find file "foo/bar.js" in path
Why?
I've tried other variations:
/Users/dimal/dev/project/src/**
/Users/dimal/dev/project/src/**/*
gf commands searches for files in the paths include via :set path
.
set path
command accepts wildcards like *
. (* means any character) So, if you wanted to include all files under subdirectories of a directory, you can give
:set path+=directory/**
For a depth of three levels under a directory, that is , to include files under any subdirectory of subdirectory of subdirectory of current directory, you can specify like directory/**3
Maximum depth allowed is 100.
A command like
:set path+=/Users/dimal/dev/project/src/**3
will allow you to search for file named bar.js in src/subdirectory/subdirectory/subdirectory
as well, not just in src/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With