tags:

views:

111

answers:

5

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?

A: 

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
soulmerge
A: 

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:

  1. Insure that you are not in Visual/Insert mode
  2. Place cursor on the first letter of the filename and press gf
Lars Tackmann
Thanks it did open the file with find command.
gearsin
A: 

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/**
martin clayton
+1  A: 

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

Rob Wells
I tried to use checkpath and its give me message "All included files were found". and yes i used set path += mypath.Thanks.
gearsin
A: 

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..

gearsin