Running vim on windows leaves behind irreproducible swap files

I run Cygwin on windows. Several times now I had a swap file left after vim after the failure, but it cannot be restored or deleted. "ls -l" shows this: -rw-r ----- 1 Unknown + User unknown + Group 12288 February 26 15: 27.pl.pl.swp

I am not allowed to be an administrator on my mailbox, so I cannot delete it. I am not the owner, so I can not delete it - it has an unknown ownership.

Any ideas on how I can remove it (without delaying the machine administrator every time)? Can I install my swap files vip in another folder so that at least they won’t clutter up my working directory (I need the correct .vimrc options to work in windows)?

+6
source share
2 answers

You can completely disable swapfiles with set noswapfile or, if you still want this feature, but not a mess, tell Vim to put these files in a dedicated location:

 set directory=c:\\tmp 

Please note that you still have to delete existing swap files manually.

For more information, read the following help topics:

 :help 'swapfile' :help swap-file :help 'directory' 
+3
source

in your case, the Windows platform

option 1: using the cmd console, go to the folder containing the swp files

 del /A:H *.swp 

option 2: using the cygwin console, go to the samely folder

 find . -type f -name "*.sw[klmnop]" -delete 
0
source

Source: https://habr.com/ru/post/983074/


All Articles