Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Tom Bodine

I was working in vim and tried to sort something. The sort didn't work as I expected.

I thought I would upgrade to version 8.0 in the hopes that would fix it. The upgrade gave me a new problem.

in my vimrc there was the line

set backupdir=$HOME/vim/backup

This no longer works and yields the dreaded "E303: Unable to open swap file"

I fixed it this way

set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP


Regards Tom Bodine

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAkesHmPF8PfkFGV6s%3DmHh%2BiO-pZbLdUuxR8rRGamoa4gqQkUw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

JohannS-2
On Mon, Feb 15, 2021 at 09:47:09AM -0600, tom wrote:

>I was working in vim and tried to sort something. The sort didn't work as I
>expected.
>
>I thought I would upgrade to version 8.0 in the hopes that would fix it.
>The upgrade gave me a new problem.
>
>in my vimrc there was the line
>
>set backupdir=$HOME/vim/backup
>
>This no longer works and yields the dreaded "E303: Unable to open swap file"
>
>I fixed it this way
>
>set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP

I would try running the following as an ex command:

:echo $HOME

It might be that Vim does not see a HOME environment
variable on Windows.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210217180002.GD14859%40linux.site.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Chris Willis

------ Original Message ------
From: [hidden email]
To: [hidden email]
Cc: [hidden email]
Sent: Wednesday, 17 Feb, 2021 At 18:00
Subject: Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

On Mon, Feb 15, 2021 at 09:47:09AM -0600, tom wrote:
I was working in vim and tried to sort something. The sort didn't work as I
expected.

I thought I would upgrade to version 8.0 in the hopes that would fix it.
The upgrade gave me a new problem.

in my vimrc there was the line

set backupdir=$HOME/vim/backup

This no longer works and yields the dreaded "E303: Unable to open swap file"

I fixed it this way

set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP

I would try running the following as an ex command:

:echo $HOME

It might be that Vim does not see a HOME environment variable on Windows.
Hi

it seems the equivalent Windows environment variable is HOMEPATH

Chris Willis
--
--
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+[hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20210217180002.GD14859%40linux.site.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/2d8e1488.353.177b22bc8b1.Webtop.52%40btinternet.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Tony Mechelynck
In reply to this post by Tom Bodine
On Tue, Feb 16, 2021 at 8:03 AM tom <[hidden email]> wrote:
>
> I was working in vim and tried to sort something. The sort didn't work as I expected.
>
> I thought I would upgrade to version 8.0 in the hopes that would fix it. The upgrade gave me a new problem.

Upgrade "to" Vim 8.0? That's rather behind the times. The latest Vim
as of this writing is version 8.2.2529. It is not at all impossible
that one of the patches between version 8.0.0 and version 8.2.2529
fixes your problem.

>
> in my vimrc there was the line
>
> set backupdir=$HOME/vim/backup
>
> This no longer works and yields the dreaded "E303: Unable to open swap file"
>
> I fixed it this way
>
> set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP

This way, at least, there is a fallback if
C:/Users/myuser/Documents/home/vim/backup is for some reason not
writable; but anyway it is a strange (but IIUC allowable) value. I
never had problems with the default value, which puts the backup file
in the same directory as the original if possible (and usually it is),
which avoids name clashes if you happen to edit files with the same
name in different directories.

On Windows, if Vim finds the HOME environment unset at startup ($HOME
in Vim and Unix terminology, %HOME% in DOS/Windows terminology), that
variable will be set for the duration of the Vim process to the
expansion of $HOMEDRIVE$HOMEPATH if $HOMEDRIVE is defined, or of
$USERPROFILE otherwise, see ":help $HOME-windows".
>
>
>
> Regards Tom Bodine

Best regards,
Tony.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsEW19TEin2FMn5ZdSEqFZgLuuuNXU1o2qHKwsMztvf1A%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Tom Bodine
Tony you are correct. When I set this
image.png
Then my old vimrc started working again.

I had had this variable set for years. its also set in my bashrc. When I installed Vim 7.22 some years ago I wrote a wrapper batch file to run vim inside a bash shell. Then I change the association for text and code files to run the script instead of gvim directly. This would insure vim would see the same variables I have in any bash shell I run. When Installed the upgrade to vim this set up was blown away, and I had forgotten what I had done. Its been two years,

Thanks

On Wed, Feb 17, 2021 at 5:42 PM Tony Mechelynck <[hidden email]> wrote:
On Tue, Feb 16, 2021 at 8:03 AM tom <[hidden email]> wrote:
>
> I was working in vim and tried to sort something. The sort didn't work as I expected.
>
> I thought I would upgrade to version 8.0 in the hopes that would fix it. The upgrade gave me a new problem.

Upgrade "to" Vim 8.0? That's rather behind the times. The latest Vim
as of this writing is version 8.2.2529. It is not at all impossible
that one of the patches between version 8.0.0 and version 8.2.2529
fixes your problem.

>
> in my vimrc there was the line
>
> set backupdir=$HOME/vim/backup
>
> This no longer works and yields the dreaded "E303: Unable to open swap file"
>
> I fixed it this way
>
> set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP

This way, at least, there is a fallback if
C:/Users/myuser/Documents/home/vim/backup is for some reason not
writable; but anyway it is a strange (but IIUC allowable) value. I
never had problems with the default value, which puts the backup file
in the same directory as the original if possible (and usually it is),
which avoids name clashes if you happen to edit files with the same
name in different directories.

On Windows, if Vim finds the HOME environment unset at startup ($HOME
in Vim and Unix terminology, %HOME% in DOS/Windows terminology), that
variable will be set for the duration of the Vim process to the
expansion of $HOMEDRIVE$HOMEPATH if $HOMEDRIVE is defined, or of
$USERPROFILE otherwise, see ":help $HOME-windows".
>
>
>
> Regards Tom Bodine

Best regards,
Tony.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAkesH%3D8t0ESwjhDpWKin6jfGmcM2Cd-axv_ej76HUrFfg%3D7EQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Tony Mechelynck
Happy to know you found what caused your problem. Have fun with Vim, and don't forget to upgrade to some not-too-old version of Vim 8.2, because Vim 8.0 is _still_ out of date.

Best regards,
Tony.

On Fri, Feb 19, 2021 at 4:36 PM tom <[hidden email]> wrote:
Tony you are correct. When I set this
image.png
Then my old vimrc started working again.

I had had this variable set for years. its also set in my bashrc. When I installed Vim 7.22 some years ago I wrote a wrapper batch file to run vim inside a bash shell. Then I change the association for text and code files to run the script instead of gvim directly. This would insure vim would see the same variables I have in any bash shell I run. When Installed the upgrade to vim this set up was blown away, and I had forgotten what I had done. Its been two years,

Thanks

On Wed, Feb 17, 2021 at 5:42 PM Tony Mechelynck <[hidden email]> wrote:
On Tue, Feb 16, 2021 at 8:03 AM tom <[hidden email]> wrote:
>
> I was working in vim and tried to sort something. The sort didn't work as I expected.
>
> I thought I would upgrade to version 8.0 in the hopes that would fix it. The upgrade gave me a new problem.

Upgrade "to" Vim 8.0? That's rather behind the times. The latest Vim
as of this writing is version 8.2.2529. It is not at all impossible
that one of the patches between version 8.0.0 and version 8.2.2529
fixes your problem.

>
> in my vimrc there was the line
>
> set backupdir=$HOME/vim/backup
>
> This no longer works and yields the dreaded "E303: Unable to open swap file"
>
> I fixed it this way
>
> set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP

This way, at least, there is a fallback if
C:/Users/myuser/Documents/home/vim/backup is for some reason not
writable; but anyway it is a strange (but IIUC allowable) value. I
never had problems with the default value, which puts the backup file
in the same directory as the original if possible (and usually it is),
which avoids name clashes if you happen to edit files with the same
name in different directories.

On Windows, if Vim finds the HOME environment unset at startup ($HOME
in Vim and Unix terminology, %HOME% in DOS/Windows terminology), that
variable will be set for the duration of the Vim process to the
expansion of $HOMEDRIVE$HOMEPATH if $HOMEDRIVE is defined, or of
$USERPROFILE otherwise, see ":help $HOME-windows".
>
>
>
> Regards Tom Bodine

Best regards,
Tony.

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXvSVcbU4utwk-qTHAdE0MW7TvcdPOnvx_AhMnQD%3DPtDsw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

Cameron Simpson-3
In reply to this post by Chris Willis
On 17Feb2021 22:45, vim_use <[hidden email]> wrote:
>I would try running the following as an ex command:
>:echo $HOME
>It might be that Vim does not see a HOME environment variable on
>Windows.
>Hi
>it seems the equivalent Windows environment variable is HOMEPATH

You could see if you can use ~/ instead of $HOME/ - if accepted that
might work in both UNIX and Windows. (Untested suggestion.)

Cheers,
Cameron Simpson <[hidden email]>

--
--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YDHjziE6QTdVUKAX%40cskk.homeip.net.