.swp files

51 views
Skip to first unread message

Kevin Reynolds

unread,
Nov 5, 2020, 6:48:52 AM11/5/20
to vim_use
God Damned Vim.
It keeps trashing my files.  I just lost a file that included everything I did in 2019 for some unknown reason.  I open up the file and vim tells me it's already open.  So I recover it, and 90% of it is gone.  This is not the first time either.  God Damn vim.  I like vim but I will never use it again.  It keeps trashing my files.  God Damn you!

Maxim Abalenkov

unread,
Nov 5, 2020, 6:53:28 AM11/5/20
to vim...@googlegroups.com
Hello Kevin,

I’m sorry to hear about the loss of your work. But potentially it is not Vim’s problem. Vim is a text editor, not a back-up software. It is our responsibility to back-up work and organise those back-up files. To my mind Vim is already doing a great job in saving all your “historic” edits in temporary files.

Best wishes,
Maxim

Maxim Abalenkov \\ maxim.a...@gmail.com
+44 7 486 486 505 \\ http://mabalenk.gitlab.io

On 5 Nov 2020, at 13:44, Kevin Reynolds <reyke...@gmail.com> wrote:

God Damned Vim.
It keeps trashing my files.  I just lost a file that included everything I did in 2019 for some unknown reason.  I open up the file and vim tells me it's already open.  So I recover it, and 90% of it is gone.  This is not the first time either.  God Damn vim.  I like vim but I will never use it again.  It keeps trashing my files.  God Damn you!

--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/cfbd522b-760a-4132-9906-6b8ea333228an%40googlegroups.com.

Tony Mechelynck

unread,
Nov 5, 2020, 8:17:15 AM11/5/20
to vim_use
On Thu, Nov 5, 2020 at 12:53 PM Maxim Abalenkov
<maxim.a...@gmail.com> wrote:
>
> Hello Kevin,
>
> I’m sorry to hear about the loss of your work. But potentially it is not Vim’s problem. Vim is a text editor, not a back-up software. It is our responsibility to back-up work and organise those back-up files. To my mind Vim is already doing a great job in saving all your “historic” edits in temporary files.
>
> —
> Best wishes,
> Maxim
>
> Maxim Abalenkov \\ maxim.a...@gmail.com
> +44 7 486 486 505 \\ http://mabalenk.gitlab.io
>
> On 5 Nov 2020, at 13:44, Kevin Reynolds <reyke...@gmail.com> wrote:
>
> God Damned Vim.
> It keeps trashing my files. I just lost a file that included everything I did in 2019 for some unknown reason. I open up the file and vim tells me it's already open. So I recover it, and 90% of it is gone. This is not the first time either. God Damn vim. I like vim but I will never use it again. It keeps trashing my files. God Damn you!

Yeah: Long before I knew about Vim, when doing translations on a PC-XT
using an editor much simpler than Vim (but anyway far less simple than
Notepad), I learnt to save my work ever quarter-hour and never to
stand up without first saving.

Now that I'm using Vim (with swapfiles enabled) I've kept the habit,
so if an electrical mains cutout forces me to wait then reboot, the
ATTENTION message will usually include the line "modified: no" which
means I can safely answer d(elete) as many times as there are
split-windows being reloaded. Vim never thrashes _my_ files.

Best regards,
Tony.

A. Wik

unread,
Nov 5, 2020, 9:35:43 AM11/5/20
to vim...@googlegroups.com
On Thu, 5 Nov 2020 at 13:17, Tony Mechelynck
<antoine.m...@gmail.com> wrote:
>
> Yeah: Long before I knew about Vim, when doing translations on a PC-XT
> using an editor much simpler than Vim (but anyway far less simple than
> Notepad), I learnt to save my work ever quarter-hour and never to
> stand up without first saving.

I do much the same. For example, with my diary, every time I add a
new comment, I save the file, and I also usually run ":wviminfo" to
save any marks I've set.

> Now that I'm using Vim (with swapfiles enabled) I've kept the habit,
> so if an electrical mains cutout forces me to wait then reboot, the
> ATTENTION message will usually include the line "modified: no" which
> means I can safely answer d(elete) as many times as there are
> split-windows being reloaded. Vim never thrashes _my_ files.

I have the same experience. I almost never have to use the recovery option.

-Albert.

Richard Mitchell

unread,
Nov 5, 2020, 10:41:53 AM11/5/20
to vim_use


On Thursday, November 5, 2020 at 6:48:52 AM UTC-5, Kevin Reynolds wrote:
God Damned Vim.
It keeps trashing my files.  I just lost a file that included everything I did in 2019 for some unknown reason.  I open up the file and vim tells me it's already open.  So I recover it, and 90% of it is gone.  This is not the first time either.  God Damn vim.  I like vim but I will never use it again.  It keeps trashing my files.  God Damn you!

 Sorry for your loss, but wonder what actually happened.   I've personally found Vim to very reliable, but I also use Mercurial (or Git) to track all file changes and keep backups on remote servers of all of my important text files.

Do you use any other editors?  Vim normally keeps a recovery file while you're editing.  If the editor does crash, then there is a possible good copy to recover from.  The file should get deleted after properly exiting Vim ( this is my world view and may not be shared by those who actually know) but gets left behind otherwise.  Assuming the latter happened and you then edited the file after that with a different editor, Vim wouldn't be aware of those changes.  Then, if you did come back to Vim, the recovery file would be old/out of date.

One you noticed the wrong information was loaded, the next step before doing anything is to either a) :q! without saving anything and/or b) go to a different terminal to verify/copy the original correct file.

And as Maxim suggested, a 2019 file should be on a backup  drive.

Wood, Geoff (Refinitiv)

unread,
Nov 5, 2020, 11:46:57 AM11/5/20
to vim...@googlegroups.com
>> On 5 Nov 2020, at 13:44, Kevin Reynolds <reyke...@gmail.com> wrote:
>>
>> God Damned Vim.
>> It keeps trashing my files. I just lost a file that included everything I did in 2019 for some unknown reason. I open up the file and vim tells me it's already open. So I recover it, and 90% of it is gone. This is not the first time either. God Damn vim. I like vim but I will never use it again. It keeps trashing my files. God Damn you

>On Thu, Nov 5, 2020 at 12:53 PM Maxim Abalenkov <maxim.a...@gmail.com> wrote:
>
> Hello Kevin,
>
> I’m sorry to hear about the loss of your work. But potentially it is not Vim’s problem. Vim is a text editor, not a back-up software. It is our responsibility to back-up work and organise those back-up files. To my mind Vim is already doing a great job in saving all your “historic” edits in temporary files.
>
> —
> Best wishes,
> Maxim
>
also

>Yeah: Long before I knew about Vim, when doing translations on a PC-XT using an editor much simpler than Vim (but anyway far less simple than Notepad), I learnt to save my work ever quarter-hour and never to stand up without first saving.

>Now that I'm using Vim (with swapfiles enabled) I've kept the habit, so if an electrical mains cutout forces me to wait then reboot, the ATTENTION message will usually include the line "modified: no" which means I can safely answer d(elete) as many times as there are split-windows being reloaded. Vim >never thrashes _my_ files.

>Best regards,
>Tony.

As someone once wrote,

Three things are certain,
Death, taxes, loss of data.
Guess which has occurred?

Just to add my voice to others, that's very frustrating and I feel your pain - from lost data in the past - but it's not vim's fault. It's surely better to spend a few hours checking into the backup settings rather than give up on a great editor you've spent at least a year on and love. Personally I go belt-and-braces - I let vim use swap files and attempt to recover them if there's a crash, which has on occasion been useful, but also save regularly myself and make backups happen. It's the only way to be sure. I've never had vim lose work for me, I've only lost work because I didn't personally save and back up. Personally. You can't trust computers. Please don't give up on a great editor and set yourself up for in a few years, "God Damned E-ditor, it keeps trashing my files as well, just like vim did."

Just like to add to the recent "Happy birthday" messages, as an IT professional I've been using vim now for about 21 years (after careful comparison with other editors) and it must have been the most consistently powerful and productive tool I've learnt. So flexible and powerful. So many people bring up problems where I can say "... Or, you can just issue these 3 commands in a minute using vim and solve it". And it supports a charity as well. Thank you Bram, and everyone.

regards,
Geoff








Kevin Reynolds

unread,
Nov 5, 2020, 12:51:57 PM11/5/20
to vim...@googlegroups.com
Thank you all for your immediate response, I did not expect that.  Truly, thank you.
Every morning when I get on my computer (MX linux) I update and backup.  I am always up to date and secure.
I know I'm human and make mistakes, but I have never had any other editor trash a whole years work before, only vim seems to do that.  I had a similar thing happen with vifm as well.  I was working with it and it trashed 1/3 of my hard disk.  WTF?  A few frantic hours later I found that vifm keeps its own trash files and I was able to restore from there.  Whew!  So I stopped using vifm, just like now I'll never use vim again.  That's a real shame.  I like vim.
I'm no programmer, just a user, and I know I make mistakes, but no other editor has ever trashed a years worth of work before.  I went to my backup and sure enough, that mistake was faithfully duplicated.  I know it was my fault, I know I did something stupid.  But how volatile does a thing have to be to trash all my work like that?  No other editor does that.  If I can't be human and make a mistake without losing all my data, that program, evidently, is out of my control and is too dangerous for me to use.
Thank you again all for your quick responses.  I really like the community for that too.  But it seems as though vim is just far too dangerous for me to use.
Thanks again,
Best,
Kevin




--
Live a good life:
If there are Gods and they are just, they will welcome you based not on how devoted you have been but based rather on the good things you did while you were alive;
If there are Gods and they are unjust, you should not want to worship them;
If there are no Gods then you will be gone, but you will be remembered for the good things you have done in your life.
 - Marcus Aurelius

Richard Mitchell

unread,
Nov 5, 2020, 1:04:44 PM11/5/20
to vim_use


On Thursday, November 5, 2020 at 12:51:57 PM UTC-5, Kevin Reynolds wrote:
Thank you all for your immediate response, I did not expect that.  Truly, thank you.
Every morning when I get on my computer (MX linux) I update and backup.  I am always up to date and secure.
I know I'm human and make mistakes, but I have never had any other editor trash a whole years work before, only vim seems to do that.  I had a similar thing happen with vifm as well.  I was working with it and it trashed 1/3 of my hard disk.  WTF?  A few frantic hours later I found that vifm keeps its own trash files and I was able to restore from there.  Whew!  So I stopped using vifm, just like now I'll never use vim again.  That's a real shame.  I like vim.
I'm no programmer, just a user, and I know I make mistakes, but no other editor has ever trashed a years worth of work before.  I went to my backup and sure enough, that mistake was faithfully duplicated.  I know it was my fault, I know I did something stupid.  But how volatile does a thing have to be to trash all my work like that?  No other editor does that.  If I can't be human and make a mistake without losing all my data, that program, evidently, is out of my control and is too dangerous for me to use.
Thank you again all for your quick responses.  I really like the community for that too.  But it seems as though vim is just far too dangerous for me to use.
Thanks again,
Best,
Kevin


You've had two catastrophic failures with two completely different programs.
I know nothing of vifm, but I've used Vim/MacVim for many years and cannot recall ever losing any data at the fault of Vim.

Vim certainly did not modify your backups, suggesting the problem occurred long before Vim prompted you to recover the file.

A good backup system should provide more than the most recent copy.  I use TimeMachine, but rsync is more than capable of doing the exact same thing.
 
On Thu, Nov 5, 2020 at 3:53 AM Maxim Abalenkov <maxim.a...@gmail.com> wrote:
Hello Kevin,

I’m sorry to hear about the loss of your work. But potentially it is not Vim’s problem. Vim is a text editor, not a back-up software. It is our responsibility to back-up work and organise those back-up files. To my mind Vim is already doing a great job in saving all your “historic” edits in temporary files.

Best wishes,
Maxim

Maxim Abalenkov \\ maxim.a...@gmail.com
+44 7 486 486 505 \\ http://mabalenk.gitlab.io
On 5 Nov 2020, at 13:44, Kevin Reynolds <reyke...@gmail.com> wrote:

God Damned Vim.
It keeps trashing my files.  I just lost a file that included everything I did in 2019 for some unknown reason.  I open up the file and vim tells me it's already open.  So I recover it, and 90% of it is gone.  This is not the first time either.  God Damn vim.  I like vim but I will never use it again.  It keeps trashing my files.  God Damn you!

--
--
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...@googlegroups.com.

--
--
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...@googlegroups.com.

Kennedy, Marcus A.

unread,
Nov 5, 2020, 4:19:48 PM11/5/20
to vim...@googlegroups.com

 

 

From: vim...@googlegroups.com <vim...@googlegroups.com> On Behalf Of Richard Mitchell
Sent: Thursday, November 5, 2020 12:05 PM
To: vim_use <vim...@googlegroups.com>
Subject: [EXTERNAL] Re: .swp files

 



On Thursday, November 5, 2020 at 12:51:57 PM UTC-5, Kevin Reynolds wrote:

Thank you all for your immediate response, I did not expect that.  Truly, thank you.

Every morning when I get on my computer (MX linux) I update and backup.  I am always up to date and secure.

I know I'm human and make mistakes, but I have never had any other editor trash a whole years work before, only vim seems to do that.  I had a similar thing happen with vifm as well.  I was working with it and it trashed 1/3 of my hard disk.  WTF?  A few frantic hours later I found that vifm keeps its own trash files and I was able to restore from there.  Whew!  So I stopped using vifm, just like now I'll never use vim again.  That's a real shame.  I like vim.

I'm no programmer, just a user, and I know I make mistakes, but no other editor has ever trashed a years worth of work before.  I went to my backup and sure enough, that mistake was faithfully duplicated.  I know it was my fault, I know I did something stupid.  But how volatile does a thing have to be to trash all my work like that?  No other editor does that.  If I can't be human and make a mistake without losing all my data, that program, evidently, is out of my control and is too dangerous for me to use.

Thank you again all for your quick responses.  I really like the community for that too.  But it seems as though vim is just far too dangerous for me to use.

Thanks again,

Best,

Kevin

 

 

You've had two catastrophic failures with two completely different programs.

I know nothing of vifm, but I've used Vim/MacVim for many years and cannot recall ever losing any data at the fault of Vim.

 

Vim certainly did not modify your backups, suggesting the problem occurred long before Vim prompted you to recover the file.

 

A good backup system should provide more than the most recent copy.  I use TimeMachine, but rsync is more than capable of doing the exact same thing.

 

Kevin,

 

I feel for you.  For me, vim has saved my skin so many times I cannot count.  I, like you just did, do stupid stuff and whack my files.  Good Ole vim is there to pull my butt out of the fire.

 

Sorry you didn’t have a similar experience.

 

Next time, STOP and ask questions BEFORE you put on the rope.

 

Andy

To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/298e6dc8-fcc2-4128-9b61-bd314f894271o%40googlegroups.com.

Ruben Safir

unread,
Nov 5, 2020, 4:23:07 PM11/5/20
to vim...@googlegroups.com, hangout
On 11/5/20 4:19 PM, Kennedy, Marcus A. wrote:
> A good backup system should provide more than the most recent copy.


PLEASE do not do this. The swp files are already enough, if not too
much. VIM is simple and works. Leave it that way. Let the user filing
this crazy complaint use openoffice (or learn good habits).



--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

Maxim Abalenkov

unread,
Nov 5, 2020, 4:43:01 PM11/5/20
to vim...@googlegroups.com
Hello Kevin et al.,

There are also a few more things you could do to with Vim to "protect your work”. First of all you can enable persistent undo. This will let you “go back in the past” of every text file you edit. When you will press “u” for undo Vim will revert the changes/edits that you made to the file. This StackExchange thread will provide you with more details: https://unix.stackexchange.com/questions/192212/vim-how-to-trace-back-all-changes-done-to-file-during-the-day. In short you may place the below settings into your .vimrc file:

" persistent undo {{{
" -------
if has("persistent_undo") && (v:version >= 704)

  set undodir=~/.vim/undodir
  set undofile
  set undolevels=1000
  set undoreload=10000

endif
" }}}

Second, you may enable Vim’s backup feature. Please see the settings below. This way your back-up directory “backupdir” will contain the back-ups of your text files that you worked on. These files will have the name of <filename>~, i.e. the file name with a tilde at the end. When you will need to recover your work you will have to go to the back-up directory and rename the “tilde” file back into the original file. For example, if you work on a file “article.tex” your back-up file will be located in ~/tmp/article.tex~. In case your article.tex gets damaged or lost, you will be able to get the recovery version from ~/tmp/article.tex~ and rename it into the original article.tex.

" backup {{{
" ------
set backup
set backupdir=~/tmp
set directory=~/tmp
set writebackup
" }}}

Finally, if you don’t know about it, yet there are plenty of version control software. For example Git. I would highly recommend you to learn it. Each project that you work on you may store in the separate repository on an online server, e.g. GitHub or GitLab. This repository can be private, if needed. It is a good practice to “commit” your changes to the Git repository at least daily. This way in the worst case you will only loose one day’s work. I hope this helps. Thank you and have a good day ahead!

Best wishes,
Maxim

Maxim Abalenkov \\ maxim.a...@gmail.com
+44 7 486 486 505 \\ http://mabalenk.gitlab.io
--
--
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+u...@googlegroups.com.

Richard Mitchell

unread,
Nov 5, 2020, 8:10:44 PM11/5/20
to vim_use


On Thursday, November 5, 2020 at 4:23:07 PM UTC-5, Ruben Safir wrote:
On 11/5/20 4:19 PM, Kennedy, Marcus A. wrote:
> A good backup system should provide more than the most recent copy.


PLEASE do not do this.  The swp files are already enough, if not too
much.  VIM is simple and works.  Leave it that way.  Let the user filing
this crazy complaint use openoffice (or learn good habits).

I wrote the part about a good backup system, not Marcus, and I was referring to an entire hard drive backup, not just vim files.

I don't care how good any program is, accidents outside a given program and hardware failures can cause problems that a program is never going to recover.  Having a full and proper hard drive backup is just good sense.

I do agree with you on the latter part, i suspect this user is either a troll or incredibly incompetent.  He claimed a 'vim recovery' trashed his file.  Even if it did load an old version, it does not automatically write it back out.  He could simply have quit without saving and left the file as it was.  If it was already corrupt, it was probably corrupt long before (since it was also corrupt on his backups), probably from improper OS shutdowns (which also explains why he's having issues with multiple programs), and had nothing at all do with vim.

gevisz

unread,
Nov 21, 2020, 3:45:25 PM11/21/20
to vim...@googlegroups.com
чт, 5 нояб. 2020 г. в 23:23, Ruben Safir <ruben...@my.liu.edu>:
>
> Let the user filing this crazy complaint use openoffice (or learn good habits).

About 10 or 15 year ago, I used an openoffice spreadsheet to keep some
of my data.
Then I suddenly lost all the data in that spreadsheet file just
because openoffice was
too slow to save it correctly during an unexpected blackout.

Since then I have no openoffice on my computer, always use text files to save
my data and edit them with just a plain text editor. For the last 7
years it has been Gvim.

Even if a sudden blackout happens, Gvim somehow manages to save all
the changes I recently made to my text files and recover them afterwards.

To make it more resilient, I have recently bought UPS. So, now I have
at least 3 minutes to manually save all my work during a sudden blackout.

Just my 5 cents. :)
Reply all
Reply to author
Forward
0 new messages