I figured it might be worthwhile for me to post my results for
posterity, now that I've whittled out a comfortable setup, in light of
how non-trivial and full of pitfalls I found it. Hopefully this may
be of use to another hapless soul on WinXP (or, for that matter, for
myself, should the unthinkable happen... disk crash, virus, etc. :)
Here's the path-setting setup in my _vimrc:
if has("win32") || has("win32unix")
let esc_home=escape($HOME,' ')
let &path =',,.'
let &path.=','.esc_home.'\python\import'
let &path.=','.esc_home.'\research\exp_acc_plan'
let &path.=','.esc_home.'\research\toolbox'
let &path.=','.esc_home.'\research\gltext'
The backslashes are a nightmare. Here's the "reading list", useful
prior to starting:
:help path # pay attention to all the special rules and exceptions
:help dos-backslash
:help option-backslash
:help filename-backslash
Pitfalls and things to watch out for:
- do not escape backslashes! (i.e., bad -> escape($HOME, ' \')); the
double backslashes cause Vim to drop any leading drive letter spec,
and treat the whole thing as a UNC name (e.g., "\\Foo\bar\baz")
- do not put a backslash as last character of a directory: if you
append another directory to it, the '\,' between them will be
interpreted in a special way (e.g., "...path\foo\bar\,path\foo\baz\"
== bad! use "...path\foo\bar,\path\foo\baz") I'm not sure how you'd
have to escape the comma to have this work properly otherwise.
- keep in mind that "foo\*" does not actually match any files in
directory "foo", only files in its (immediate) subdirectories