Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1020403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:09:42+00:00 2026-05-16T11:09:42+00:00

Is it possible to automatically remove the swapfile when the file is saved, and

  • 0

Is it possible to automatically remove the swapfile when the file is saved, and automatically create it again when the file is changed?

And is this a good idea?

EDIT:
The reason for wanting to to this is so that I don’t have to go through the diff process for files that had no changes after last save if the computer suddenly ran out of power or crashed.

The diff process referred to is; first open the file read only, saving it under a different filename, vimdiffing it and in the end delete it.

It doesn’t happen often, but is just as annoying when it does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:09:42+00:00Added an answer on May 16, 2026 at 11:09 am

    Is it possible to automatically remove the swapfile when the file is saved, and automatically create it again when the file is changed?

    And is this a good idea?

    Deletion and creation of a file are relatively slow operations. It makes sense to keep the swap file in case if one going to keep editing. Or why else one would keep the VIM running?

    Additionally VIM uses the swap file to detect attempts to edit the same file from different VIM instances.

    All in all, I think it is a bad idea to try to remove the file.

    P.S. Worth noting that when VIM is started in read-only mode as view or vim -R, it doesn’t create the swap file. But if once you change the file, the swap file is going to be created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SQL Server 2005, is it possible to automatically set transaction isolation level to,
Thank you for taking the time to read this and I will appreciate every
I am evaluating hundreds of thousands of html files. I am looking for particular
In my application the user selects an image. When the ACTION_GET_CONTENT intent is launched
If I have some types e.g: public class SomeType //Generated by some codegen i
About a year ago, a question was asked on stackoverflow about how to horizontally
I am programming a desktop application in Delphi. So far I've been using TWebBrowser
Question: Today I worked with MS Visual Sourcesafe, that is to say Microsoft's Sourcecode
I was using HashMap before like public Map<SocketChannel, UserProfile> clients = new HashMap<SocketChannel, UserProfile>();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.