'path' option values of excessive length

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

'path' option values of excessive length

Doug Kearns
G'day all,

Has anyone already come up with a solution to 'path' option values of
excessive length?  ie. over the maximum system dependent length

Thanks,
Doug
Reply | Threaded
Open this post in threaded view
|

Re: 'path' option values of excessive length

John (Eljay) Love-Jensen
Use one or more of these techniques:

1. Use the (old style) short file names in your PATH.  For example, instead
of "C:\Program Files" use "C:\PROGRA~1".

2. Make a SHARE folder & "NET USE" drive mappings.  Use that drive mapping
in your PATH.

3. Use "SUBST" drive mappings.  WARNING:  on NTFS, this  any pre-existing
ACL by setting up a new ACL repository for those files, rooted at the new
SUBST drive mapping.  Although the ACL issue is a hassle, it doesn't have
the drawbacks of publishing a share folder.  Use that drive mapping in your
PATH.

4. Use Linux.  Or buy a Mac.  (I know, I know... probably not a viable
option.  But if I don't mention it the Underpants Gnomes will raid my
dresser.)

HTH,
--Eljay

Reply | Threaded
Open this post in threaded view
|

Re: 'path' option values of excessive length

Doug Kearns
On Mon, Sep 19, 2005 at 06:43:19AM -0500, John Love-Jensen wrote:
> Use one or more of these techniques:

<snip - some Windows malarkey ;-)>
 
> 4. Use Linux.  Or buy a Mac.  (I know, I know... probably not a viable
> option.  But if I don't mention it the Underpants Gnomes will raid my
> dresser.)

I do run Linux but my 'path' is already at 17369 chars.

I've written a script in Ruby that handles this by remapping gf and
friends and does the path lookup itself but... I was hoping someone
might have a drop-in vimscript solution. ;-)

Thanks,
Doug
Reply | Threaded
Open this post in threaded view
|

Re: 'path' option values of excessive length

Tim Chase-2
> <snip - some Windows malarkey ;-)>

Well, at least they were very good suggestions, even if for the
wrong OS :)  I would have suggested the SUBST solution, but
didn't know about Eljay's caveat regarding ACLs on NTFS.  I'd shy
away from exporting and reimporting shares, but it was an
innovative solution too.

> I do run Linux but my 'path' is already at 17369 chars.

[gives a look something between shock and incredulity, but can't
come up with an adequate emoticon]

My first thought would be to make a whole bunch of soft-links
with much shorter path names to your target directories, and then
reference them instead of the whole path.  Instead of

# echo $PATH
/bin:/usr/bin:/here/there/elsewhere/bang/bork/ding
# ln -s /here/there/elsewhere/bang/bork/ding ~/ding
# export PATH=/bin:/usr/bin:$HOME/ding

or something of the sort.  You could create a folder called
something like ~/path  and consolodate all your path search links
in there to keep matters tidy.  Then you could have your PATH set
to something like

/bin:/usr/bin:~/path/bork:~/path/foo:~/path/fred:~/path/chinchilla

and the like.  You could even call the directory ~/p to cut out 3
more characters per item...and then you could change your login
from, say "dougkearns" to "dk" saving you another 8 characters... :)

I don't know if that's anywhere near a usable solution, but it
might cut down on the [rolls eyes] 17369 characters in your path :*)

-tim





Reply | Threaded
Open this post in threaded view
|

Re: 'path' option values of excessive length

Doug Kearns
On Mon, Sep 19, 2005 at 11:50:47AM -0500, Tim Chase wrote:

<snip>
 
> >I do run Linux but my 'path' is already at 17369 chars.
>
> [gives a look something between shock and incredulity, but can't
> come up with an adequate emoticon]

The vim 'path' option (:help 'path') not my Unix command search path. ;-)

I'm setting this to the Ruby library $LOAD_PATH in the Ruby filetype
plugin but now that the gems package manager has become so popular the
length of this value has grown. RubyGems stores all the library packages
in individual directories each with it's own lib directory. Prior to
RubyGems all library files were stored in a common directory.

<snip>
 
> I don't know if that's anywhere near a usable solution, but it
> might cut down on the [rolls eyes] 17369 characters in your path :*)

Thanks. It's a distributed ftplugin so it needs to be a 'drop-in'
solution. I may, unfortunately, just have to write a function to perform
some of the work and remap the relevant commands. Although having to
replace :find with :Find is a PITA...

Thanks,
Doug