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

  • Home
  • SEARCH
  • 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 6144495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:39:32+00:00 2026-05-23T18:39:32+00:00

Vim’s file backup system just saved my proverbial @$$ but I have a question.

  • 0

Vim’s file backup system just saved my proverbial @$$ but I have a question.

I have vim saving backups to ~/.vim/backups

To restore them I went to the directory and (sorted by date) copied the files I needed back to the necessary directories in my project folder. Easy enough, there were only 5 files. However, I’m surprised there’s no obvious way to find which directory each file came from. I tried using vim -r path/to/file but that seems to use the swap and not the backup file. Since in my case vim didn’t crash (I just mistakenly overwrote the files) there is no swap for these files.

So the main question is: What is the best way to restore vim backup files?

Side question: What happens in the .vim/backup/ directory when I have two same-name files from different paths (e.g. /path/one/file.html and /path/two/file.html)?

  • 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-23T18:39:33+00:00Added an answer on May 23, 2026 at 6:39 pm

    From what I can tell, Vim doesn’t save any information at all regarding the file’s original location.

    Saving a backup of two same-name files could either overwrite the existing backup or use a different name, depending on what’s set in your .vimrc. The option ‘backup’ will overwrite an existing backup file, but ‘writebackup’ will re-name a new backup in order to avoid an overwrite.

    Check out Vim’s documentation for more info – :help backup

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

Sidebar

Related Questions

Vim (actually, gvim is in question, but I believe it works both ways) upon
Vim supports multiple file types for the main file formats. But this does not
In Vim I have: simulación (fig.),pretexto (fig.),excusa (fig.). My goal is: simulación ,pretexto ,excusa
My Vim editor auto highlights PHP files ( vim file.php ), HTML files (
Inside Vim on Windows, I'm trying to filter the lines in a file through
Vim customization -- I have added these lines in my .vimrc inoremap /* /**/<
my vim show tab as --->, but does not show windows ^M character. And
In vim, I set shiftwidth=2, but all my previous indents are still at the
my vim is 7.0 and I can't update it to 7.3, i don't have
Using Vim 6.0. Say I'm editing this file: sdfsdg dfgdfg 34 12 2 4

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.