Thursday, August 9, 2018

Re: Avoid "auto" short paths

On 2018-08-09, Cesar Martins wrote:
> Em qui, 9 de ago de 2018 às 17:09, Bram Moolenaar escreveu:
>
>
> > This is the company environment, is very common users have they own disk
> > areas at the network of the company, which usually is a drive mapping and
> > set at HOMEDRIVE and HOMEPATH.
>
> So HOMEDRIVE and HOMEPATH are always set?  Then these should be used,
> they are checked before USERPROFILE.
>
>
> Yes , they are always set. 
>  
>
> > When I open the file , at %USERPROFILE% which is my local drive , vim
> > internally change the path references from c:\Users\cinacio
> (%USERPROFILE%)
> > to "~" .
> > But when vim expand "~" and exists HOMEDRIVE and HOMEPATH set, they use
> it.
> >
> > I know I can force my HOME setting %HOME%=3D%USERPROFILE% at windows
> > environment.
> > But I have others programs at my desktop and I don't know how this can
> > affect them, so I would to avoid set the %HOME%
> >
> > That's why I would force vim works always with absolute path.
>
> When HOMEDRIVE and HOMEPATH are set, then USERPROFILE should not be
> used.  Are you saying that HOMEDRIVE and HOMEPATH are sometimes not set?
> That effectively means your home directory moves around, so it's
> expected that Vim doesn't handle that.
>
>
> As mentioned before , the HOMEPATH and HOMEDRIVE is always set. 
> My home directory don't move around. 
> I'm not obligated for the company to save everything at the network home dir. 
> So , I have a lot of documents and files at my regular documents (USERPROFILE/
> Documents)
> But vim get lost when I open a document on it.
>  
>
> Using an absolute path has the opposite effect: If your home directory
> is on a dynamically mounted drive, the drive letter can change while
> it's still the same directory.  Then using "~/" is actually avoiding
> problems.  Thus we can't use the full path as a default.
>
>
> Is not this situation.
>  
>
> I think having to set $HOME is acceptable.
>
>
> I tried , but this mess configuration from few applications like cygwin and I
> use it a lot. 

I'm in the same kind of corporate Windows environment and I can
replicate your results.

When %HOMEDRIVE%, %HOMEPATH% and %USERPROFILE% are all defined in
the environment, and %HOME% is not, I don't think I particularly
care whether Vim synthesizes %HOME% from %HOMEDRIVE% and %HOMEPATH%
or from %USERPROFILE%, but I do think it should be consistent. When
Vim is started, it should look at %HOMEDRIVE%, %HOMEPATH%,
%USERPROFILE% and %HOME%, and if %HOME% is not defined, set it
according to some algorithm and leave it alone. It appears that Vim
is instead creating %HOME% differently for different purposes.
That's not good.

For the record, the environment of my cmd.exe includes:

HOMEDRIVE=G:
HOMEPATH=\
USERPROFILE=C:\Users\gary

but no HOME. From the Start menu, Windows runs cmd.exe in my
%USERPROFILE% directory.

I first run gvim like this:

"C:\Program Files (x86)\vim\vim81\gvim.exe" -N -u NONE Documents\tmp3.txt

Vim's title bar says:

tmp3.txt (~\Documents) - GVIM

I enter some text in the file, then

:w
:mksession
:q

Then I run gvim like this:

"C:\Program Files (x86)\vim\vim81\gvim.exe" -N -u NONE -S

Vim's title bar says:

tmp3.txt (G:\Documents) - GVIM

The status line says:

"Documents\tmp3.txt" [New File]

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment