Vim: Unable to set "path" correctly to make gf work

I am trying to get gfwork with paths that look like this:

foo/bar.js

The file is here: /Users/dimal/dev/project/src/foo/bar.js

So, I installed mine pathas follows:

set path+=/Users/dimal/dev/project/src

It seems that it gfshould find the file, but it does not.

E447: Can't find file "foo/bar.js" in path

Why?

I tried other options:

/Users/dimal/dev/project/src/**
/Users/dimal/dev/project/src/**/*
+4
source share
1 answer

The gf commands for finding files in paths include via :set path.

Team

set pathaccepts wildcards such as *. (* means any character). So, if you want to include all files in subdirectories of a directory, you can give

      :set path+=directory/**

, , directory/**3

- 100.

       :set path+=/Users/dimal/dev/project/src/**3

bar.js src/subdirectory/subdirectory/subdirectory, src/.

+1

All Articles