I am using Vim and I have set the path (set path+= c:/work/etc/etc
) to my project directory (for C#), but still using command 'gf' give me error:
E:447 Can't find file.
Is there anything I am doing wrong over here?
I am using Vim and I have set the path (set path+= c:/work/etc/etc
) to my project directory (for C#), but still using command 'gf' give me error:
E:447 Can't find file.
Is there anything I am doing wrong over here?
Make sure there is no leading character to the file name if you press gf
, i.e. using gf
when the cursor is on help.txt will not work here:
file=help.txt
First can you open the file using :find file.name ? (:help find for more info). If this does not work then your path is wrong. If :find does locate your file then do the following:
If you place a single directory on the path then files in that directory can be found, but not in subdirectories. You might want to add some wildcards so that subdirectories can be used too.
For example
set path+=c:/work/**
G'day,
To get a bit more detail on your current path settings you can see what's being included and the files vim can't find by entering the command:
:checkpath
and you'll get a dump of the files not found, e.g.
--- Included files not found in path ---
<io.h>
vim.h -->
<functions.h>
<clib/exec_protos.h>
Or you can get a listing of all included files, both found and not found, by entering
:checkpath!
Enter
:help path
to get more info on the path syntax.
Edit: Don't forget that using the syntax
set path=/work
will completely reset your path variable to what you've just declared. I'd suggest using
set path+=/work
instead. This won't clobber the current path and will just add your /work directory instead.
HTH
Thanks everyone for the reply. Actually it was my mistake bcoz of that it wasnt working ( i put 'c' in front of class name and also i was trying to use this on class name). Can anyone suggest me how i can override the 'gf' so it call my function where i can take the word in current cursor and modify to generate the file name.
Thanks..