Loading ...
Sorry, an error occurred while loading the content.

Re: vim: recover an unnamed file

Expand Messages
  • Rostislav Svoboda
    ... http://askubuntu.com/questions/142688/cpu-frequency-scaling-for-12-04 I have a couple of stories about a friend of mine who drilled a hole to his laptop
    Message 1 of 14 , May 16, 2013
    • 0 Attachment
      > My PC (ubuntu) just restarted by itself due to the (stupid) overheat issue,
      > again (I couldn't find a solution on that in a year..)

      http://askubuntu.com/questions/142688/cpu-frequency-scaling-for-12-04

      I have a couple of stories about a friend of mine who drilled a hole
      to his laptop trying to improve cooling, to no avail. He ended up
      using ice-packs underneath his laptop.

      Bost

      PS: Oh sorry I'm on a wrong mailing list :)

      --
      --
      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+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • tooth pik
      ... one thing I ve found helpful in different circumstances is to set the directory option in my .vimrc to a single known folder (~/.vim-tmp) -- that way all
      Message 2 of 14 , May 16, 2013
      • 0 Attachment
        On Thu, May 16, 2013 at 06:53:51PM -0400, ping wrote:
        > guys:
        > My PC (ubuntu) just restarted by itself due to the (stupid) overheat
        > issue, again (I couldn't find a solution on that in a year..)

        > but regardless, I had a file that I had been editing for quite a while.
        > all of a sudden the PC reloaded, now I'm wondering how can I recover
        > that file.

        one thing I've found helpful in different circumstances is to set the
        'directory' option in my .vimrc to a single known folder (~/.vim-tmp)
        -- that way all swap files are created in the same place, facilitating
        both recovery and scripting -- I like to make sure there are no
        swapfiles before starting an extensive session

        sc

        --
        --
        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+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Gary Johnson
        ... After a quick look at Vim s memline.c, I think you are the victim of poor housekeeping and a bug in Vim. You may still be able to recover your files
        Message 3 of 14 , May 16, 2013
        • 0 Attachment
          On 2013-05-16, ping wrote:
          > guys:
          > My PC (ubuntu) just restarted by itself due to the (stupid) overheat
          > issue, again (I couldn't find a solution on that in a year..)
          >
          > but regardless, I had a file that I had been editing for quite a while.
          > all of a sudden the PC reloaded, now I'm wondering how can I recover
          > that file.
          >
          > I tried both of the following method , but none of them give me the
          > right file.
          >
          > one thing I've notice that if I'm in different folder, vim -r give me
          > different files. I tried to change to different folder and invoke vim
          > -r, but still failed to find the right one (per the timestamp) for
          > me...
          >
          > any other good ideals?
          >
          > maybe the last resort, do I have to grep from the whole harddisk for this?
          >
          > and, what's the best practice to solve this issue in the future
          > (lesson learned for me: always use a named buffer ) ?
          >
          >
          > 1) :recover
          >
          > Swap files found:
          > Using specified name:
          > 1. .swa
          > owned by: ping dated: Fri Jan 21 17:26:35 2011
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 14418
          > 2. .swb
          > owned by: ping dated: Wed Dec 29 14:32:22 2010
          > file name: [No Name]
          > modified: no
          > user name: ping host name: 640g-laptop
          > process ID: 7874
          > 3. .swc
          > owned by: ping dated: Fri Dec 17 17:05:02 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 2735
          > 4. .swd
          > owned by: ping dated: Mon Dec 6 17:57:06 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 22947
          > 5. .swe
          > owned by: ping dated: Fri Oct 29 08:15:23 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 20799
          > 6. .swf
          > owned by: ping dated: Thu Dec 2 13:05:32 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 5370
          > 7. .swg
          > owned by: ping dated: Sat Oct 23 11:38:18 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 4930
          > 8. .swh
          > owned by: ping dated: Sat Oct 23 06:40:55 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 3119
          > 9. .swi
          > owned by: ping dated: Sat Oct 16 23:28:22 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 13572
          > 10. .swj
          > owned by: ping dated: Sat Oct 23 06:35:33 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 4930
          > 11. .swk
          > owned by: ping dated: Tue Oct 12 10:15:05 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 13672
          > 12. .swl
          > owned by: ping dated: Sun Oct 10 06:44:29 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 26777
          > 13. .swm
          > owned by: ping dated: Wed Oct 6 00:44:37 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 29373
          > 14. .swn
          > owned by: ping dated: Tue Oct 5 03:59:02 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 29373
          > 15. .swo
          > owned by: ping dated: Sun Sep 26 09:34:44 2010
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 3824
          > 16. .swp
          > owned by: ping dated: Fri Apr 20 15:59:12 2012
          > file name: [No Name]
          > modified: YES
          > user name: ping host name: 640g-laptop
          > process ID: 17594
          > In directory ~/tmp:
          > -- none --
          > In directory /var/tmp:
          > -- none --
          > In directory /tmp:
          > -- none --
          >
          > Enter number of swap file to use (0 to quit): 0

          After a quick look at Vim's memline.c, I think you are the victim of
          poor housekeeping and a bug in Vim. You may still be able to
          recover your files though.

          Note that your oldest swap file is named ".swp", the next oldest is
          named ".swo", and that pattern of decreasing last letters continues
          through your newest swap file which is named ".swa". Note, too,
          that your newest swap file is pretty old, from January 2011. I
          doubt that that is the last time you used an unnamed buffer.

          When Vim creates a swap file, it first tries the suffix ".swp". If
          that file exists, Vim decrements the last letter and tries again.
          When the suffix becomes ".swa" and that file exists, Vim then
          decrements the second-to-last letter, sets the last letter to "z",
          and tries again. It continues to look for swap file names that
          don't exists until it reaches the suffix ".saa", then gives up.

          Now, when Vim looks for swap files, it looks for files with suffixes
          matching the pattern ".sw?". This will find only the first 16 swap
          files. It ignores any swap files created with a second letter other
          than "w".

          That is a bug and needs to be fixed. Vim should either look for
          swap files whose suffixes match the pattern ".s??" or stop creating
          swap files with suffixes whose second letter is other than "w".

          To your problem: It is quite likely that the same directories that
          contain files named ".swa" also contain files named ".svz", ".svy",
          and so on. Those are valid Vim swap files, but Vim doesn't
          recognize them as such by those names.

          I would suggest first verifying that you do not care about the files
          matching the pattern ".sw?", then delete them. Then find the newest
          file with a name matching the pattern ".s??", rename it to ".swp",
          and try recovering it.

          Once you've recovered all your files, I would suggest that you close
          all instances of Vim and do a sweep of your file system using find
          (not grep) to find all your swap files. Again be sure that you do
          not need them, then delete them all. In the future, pay attention
          to swap files left over after crashes and keep them cleaned up.

          Regards,
          Gary

          --
          --
          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+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • ping
          ... yes I think this is a really stupid issue in ubuntu that is lacking a good solution now. I m wondering I maybe need to re-set the temporation limit in
          Message 4 of 14 , May 16, 2013
          • 0 Attachment
            On 5/16/2013 7:10 PM, Rostislav Svoboda wrote:
            >> My PC (ubuntu) just restarted by itself due to the (stupid) overheat issue,
            >> again (I couldn't find a solution on that in a year..)
            > http://askubuntu.com/questions/142688/cpu-frequency-scaling-for-12-04
            >
            > I have a couple of stories about a friend of mine who drilled a hole
            > to his laptop trying to improve cooling, to no avail. He ended up
            > using ice-packs underneath his laptop.
            >
            > Bost
            >
            > PS: Oh sorry I'm on a wrong mailing list :)
            yes I think this is a really stupid issue in ubuntu that is lacking a
            good solution now.
            I'm wondering I maybe need to re-set the temporation limit in bios...

            --
            --
            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+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • ping
            ... that sounds a good idea, but what will happen if you have two files in different folders have the same name? will VIM associate each file with a different
            Message 5 of 14 , May 16, 2013
            • 0 Attachment
              On 5/16/2013 7:28 PM, tooth pik wrote:
              > one thing I've found helpful in different circumstances is to set the
              > 'directory' option in my .vimrc to a single known folder (~/.vim-tmp)
              > -- that way all swap files are created in the same place, facilitating
              > both recovery and scripting -- I like to make sure there are no
              > swapfiles before starting an extensive session
              that sounds a good idea, but what will happen if you have two files in
              different folders have the same name?
              will VIM associate each file with a different swap file name without
              confusion?

              thanks!

              regards
              ping

              --
              --
              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+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • ping
              ... thanks Gary, I think I only undertsand some part of your explanations. can you detail the steps for me to recover my file? -- -- You received this message
              Message 6 of 14 , May 16, 2013
              • 0 Attachment
                On 5/16/2013 8:48 PM, Gary Johnson wrote:
                > On 2013-05-16, ping wrote:
                >> guys:
                >> My PC (ubuntu) just restarted by itself due to the (stupid) overheat
                >> issue, again (I couldn't find a solution on that in a year..)
                >>
                >> but regardless, I had a file that I had been editing for quite a while.
                >> all of a sudden the PC reloaded, now I'm wondering how can I recover
                >> that file.
                >>
                >> I tried both of the following method , but none of them give me the
                >> right file.
                >>
                >> one thing I've notice that if I'm in different folder, vim -r give me
                >> different files. I tried to change to different folder and invoke vim
                >> -r, but still failed to find the right one (per the timestamp) for
                >> me...
                >>
                >> any other good ideals?
                >>
                >> maybe the last resort, do I have to grep from the whole harddisk for this?
                >>
                >> and, what's the best practice to solve this issue in the future
                >> (lesson learned for me: always use a named buffer ) ?
                >>
                >>
                >> 1) :recover
                >>
                >> Swap files found:
                >> Using specified name:
                >> 1. .swa
                >> owned by: ping dated: Fri Jan 21 17:26:35 2011
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 14418
                >> 2. .swb
                >> owned by: ping dated: Wed Dec 29 14:32:22 2010
                >> file name: [No Name]
                >> modified: no
                >> user name: ping host name: 640g-laptop
                >> process ID: 7874
                >> 3. .swc
                >> owned by: ping dated: Fri Dec 17 17:05:02 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 2735
                >> 4. .swd
                >> owned by: ping dated: Mon Dec 6 17:57:06 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 22947
                >> 5. .swe
                >> owned by: ping dated: Fri Oct 29 08:15:23 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 20799
                >> 6. .swf
                >> owned by: ping dated: Thu Dec 2 13:05:32 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 5370
                >> 7. .swg
                >> owned by: ping dated: Sat Oct 23 11:38:18 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 4930
                >> 8. .swh
                >> owned by: ping dated: Sat Oct 23 06:40:55 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 3119
                >> 9. .swi
                >> owned by: ping dated: Sat Oct 16 23:28:22 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 13572
                >> 10. .swj
                >> owned by: ping dated: Sat Oct 23 06:35:33 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 4930
                >> 11. .swk
                >> owned by: ping dated: Tue Oct 12 10:15:05 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 13672
                >> 12. .swl
                >> owned by: ping dated: Sun Oct 10 06:44:29 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 26777
                >> 13. .swm
                >> owned by: ping dated: Wed Oct 6 00:44:37 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 29373
                >> 14. .swn
                >> owned by: ping dated: Tue Oct 5 03:59:02 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 29373
                >> 15. .swo
                >> owned by: ping dated: Sun Sep 26 09:34:44 2010
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 3824
                >> 16. .swp
                >> owned by: ping dated: Fri Apr 20 15:59:12 2012
                >> file name: [No Name]
                >> modified: YES
                >> user name: ping host name: 640g-laptop
                >> process ID: 17594
                >> In directory ~/tmp:
                >> -- none --
                >> In directory /var/tmp:
                >> -- none --
                >> In directory /tmp:
                >> -- none --
                >>
                >> Enter number of swap file to use (0 to quit): 0
                > After a quick look at Vim's memline.c, I think you are the victim of
                > poor housekeeping and a bug in Vim. You may still be able to
                > recover your files though.
                >
                > Note that your oldest swap file is named ".swp", the next oldest is
                > named ".swo", and that pattern of decreasing last letters continues
                > through your newest swap file which is named ".swa". Note, too,
                > that your newest swap file is pretty old, from January 2011. I
                > doubt that that is the last time you used an unnamed buffer.
                >
                > When Vim creates a swap file, it first tries the suffix ".swp". If
                > that file exists, Vim decrements the last letter and tries again.
                > When the suffix becomes ".swa" and that file exists, Vim then
                > decrements the second-to-last letter, sets the last letter to "z",
                > and tries again. It continues to look for swap file names that
                > don't exists until it reaches the suffix ".saa", then gives up.
                >
                > Now, when Vim looks for swap files, it looks for files with suffixes
                > matching the pattern ".sw?". This will find only the first 16 swap
                > files. It ignores any swap files created with a second letter other
                > than "w".
                >
                > That is a bug and needs to be fixed. Vim should either look for
                > swap files whose suffixes match the pattern ".s??" or stop creating
                > swap files with suffixes whose second letter is other than "w".
                >
                > To your problem: It is quite likely that the same directories that
                > contain files named ".swa" also contain files named ".svz", ".svy",
                > and so on. Those are valid Vim swap files, but Vim doesn't
                > recognize them as such by those names.
                >
                > I would suggest first verifying that you do not care about the files
                > matching the pattern ".sw?", then delete them. Then find the newest
                > file with a name matching the pattern ".s??", rename it to ".swp",
                > and try recovering it.
                >
                > Once you've recovered all your files, I would suggest that you close
                > all instances of Vim and do a sweep of your file system using find
                > (not grep) to find all your swap files. Again be sure that you do
                > not need them, then delete them all. In the future, pay attention
                > to swap files left over after crashes and keep them cleaned up.
                >
                > Regards,
                > Gary
                >
                thanks Gary, I think I only undertsand some part of your explanations.
                can you detail the steps for me to recover my file?


                --
                --
                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+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Ping
                and, I just found that I had the swap file disabled :( ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below
                Message 7 of 14 , May 16, 2013
                • 0 Attachment
                  and, I just found that I had the swap file disabled :(




                  On May 16, 2013, at 10:41 PM, ping <songpingemail@...> wrote:

                  > On 5/16/2013 8:48 PM, Gary Johnson wrote:
                  >> On 2013-05-16, ping wrote:
                  >>> guys:
                  >>> My PC (ubuntu) just restarted by itself due to the (stupid) overheat
                  >>> issue, again (I couldn't find a solution on that in a year..)
                  >>>
                  >>> but regardless, I had a file that I had been editing for quite a while.
                  >>> all of a sudden the PC reloaded, now I'm wondering how can I recover
                  >>> that file.
                  >>>
                  >>> I tried both of the following method , but none of them give me the
                  >>> right file.
                  >>>
                  >>> one thing I've notice that if I'm in different folder, vim -r give me
                  >>> different files. I tried to change to different folder and invoke vim
                  >>> -r, but still failed to find the right one (per the timestamp) for
                  >>> me...
                  >>>
                  >>> any other good ideals?
                  >>>
                  >>> maybe the last resort, do I have to grep from the whole harddisk for this?
                  >>>
                  >>> and, what's the best practice to solve this issue in the future
                  >>> (lesson learned for me: always use a named buffer ) ?
                  >>>
                  >>>
                  >>> 1) :recover
                  >>>
                  >>> Swap files found:
                  >>> Using specified name:
                  >>> 1. .swa
                  >>> owned by: ping dated: Fri Jan 21 17:26:35 2011
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 14418
                  >>> 2. .swb
                  >>> owned by: ping dated: Wed Dec 29 14:32:22 2010
                  >>> file name: [No Name]
                  >>> modified: no
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 7874
                  >>> 3. .swc
                  >>> owned by: ping dated: Fri Dec 17 17:05:02 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 2735
                  >>> 4. .swd
                  >>> owned by: ping dated: Mon Dec 6 17:57:06 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 22947
                  >>> 5. .swe
                  >>> owned by: ping dated: Fri Oct 29 08:15:23 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 20799
                  >>> 6. .swf
                  >>> owned by: ping dated: Thu Dec 2 13:05:32 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 5370
                  >>> 7. .swg
                  >>> owned by: ping dated: Sat Oct 23 11:38:18 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 4930
                  >>> 8. .swh
                  >>> owned by: ping dated: Sat Oct 23 06:40:55 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 3119
                  >>> 9. .swi
                  >>> owned by: ping dated: Sat Oct 16 23:28:22 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 13572
                  >>> 10. .swj
                  >>> owned by: ping dated: Sat Oct 23 06:35:33 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 4930
                  >>> 11. .swk
                  >>> owned by: ping dated: Tue Oct 12 10:15:05 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 13672
                  >>> 12. .swl
                  >>> owned by: ping dated: Sun Oct 10 06:44:29 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 26777
                  >>> 13. .swm
                  >>> owned by: ping dated: Wed Oct 6 00:44:37 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 29373
                  >>> 14. .swn
                  >>> owned by: ping dated: Tue Oct 5 03:59:02 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 29373
                  >>> 15. .swo
                  >>> owned by: ping dated: Sun Sep 26 09:34:44 2010
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 3824
                  >>> 16. .swp
                  >>> owned by: ping dated: Fri Apr 20 15:59:12 2012
                  >>> file name: [No Name]
                  >>> modified: YES
                  >>> user name: ping host name: 640g-laptop
                  >>> process ID: 17594
                  >>> In directory ~/tmp:
                  >>> -- none --
                  >>> In directory /var/tmp:
                  >>> -- none --
                  >>> In directory /tmp:
                  >>> -- none --
                  >>>
                  >>> Enter number of swap file to use (0 to quit): 0
                  >> After a quick look at Vim's memline.c, I think you are the victim of
                  >> poor housekeeping and a bug in Vim. You may still be able to
                  >> recover your files though.
                  >>
                  >> Note that your oldest swap file is named ".swp", the next oldest is
                  >> named ".swo", and that pattern of decreasing last letters continues
                  >> through your newest swap file which is named ".swa". Note, too,
                  >> that your newest swap file is pretty old, from January 2011. I
                  >> doubt that that is the last time you used an unnamed buffer.
                  >>
                  >> When Vim creates a swap file, it first tries the suffix ".swp". If
                  >> that file exists, Vim decrements the last letter and tries again.
                  >> When the suffix becomes ".swa" and that file exists, Vim then
                  >> decrements the second-to-last letter, sets the last letter to "z",
                  >> and tries again. It continues to look for swap file names that
                  >> don't exists until it reaches the suffix ".saa", then gives up.
                  >>
                  >> Now, when Vim looks for swap files, it looks for files with suffixes
                  >> matching the pattern ".sw?". This will find only the first 16 swap
                  >> files. It ignores any swap files created with a second letter other
                  >> than "w".
                  >>
                  >> That is a bug and needs to be fixed. Vim should either look for
                  >> swap files whose suffixes match the pattern ".s??" or stop creating
                  >> swap files with suffixes whose second letter is other than "w".
                  >>
                  >> To your problem: It is quite likely that the same directories that
                  >> contain files named ".swa" also contain files named ".svz", ".svy",
                  >> and so on. Those are valid Vim swap files, but Vim doesn't
                  >> recognize them as such by those names.
                  >>
                  >> I would suggest first verifying that you do not care about the files
                  >> matching the pattern ".sw?", then delete them. Then find the newest
                  >> file with a name matching the pattern ".s??", rename it to ".swp",
                  >> and try recovering it.
                  >>
                  >> Once you've recovered all your files, I would suggest that you close
                  >> all instances of Vim and do a sweep of your file system using find
                  >> (not grep) to find all your swap files. Again be sure that you do
                  >> not need them, then delete them all. In the future, pay attention
                  >> to swap files left over after crashes and keep them cleaned up.
                  >>
                  >> Regards,
                  >> Gary
                  >>
                  > thanks Gary, I think I only undertsand some part of your explanations.
                  > can you detail the steps for me to recover my file?
                  >
                  >

                  --
                  --
                  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+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Gary Johnson
                  ... [...] ... That s unfortunate. Does that mean that you no longer need a better explanation? Regards, Gary -- -- You received this message from the
                  Message 8 of 14 , May 16, 2013
                  • 0 Attachment
                    On 2013-05-17, Ping wrote:

                    > On May 16, 2013, at 10:41 PM, ping wrote:
                    >
                    > > On 5/16/2013 8:48 PM, Gary Johnson wrote:

                    > >> After a quick look at Vim's memline.c, I think you are the victim of
                    > >> poor housekeeping and a bug in Vim. You may still be able to
                    > >> recover your files though.

                    [...]

                    > >> To your problem: It is quite likely that the same directories that
                    > >> contain files named ".swa" also contain files named ".svz", ".svy",
                    > >> and so on. Those are valid Vim swap files, but Vim doesn't
                    > >> recognize them as such by those names.
                    > >>
                    > >> I would suggest first verifying that you do not care about the files
                    > >> matching the pattern ".sw?", then delete them. Then find the newest
                    > >> file with a name matching the pattern ".s??", rename it to ".swp",
                    > >> and try recovering it.
                    > >>
                    > >> Once you've recovered all your files, I would suggest that you close
                    > >> all instances of Vim and do a sweep of your file system using find
                    > >> (not grep) to find all your swap files. Again be sure that you do
                    > >> not need them, then delete them all. In the future, pay attention
                    > >> to swap files left over after crashes and keep them cleaned up.

                    > > thanks Gary, I think I only undertsand some part of your explanations.
                    > > can you detail the steps for me to recover my file?

                    > and, I just found that I had the swap file disabled :(

                    That's unfortunate. Does that mean that you no longer need a better
                    explanation?

                    Regards,
                    Gary

                    --
                    --
                    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+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Gary Johnson
                    ... You can specify directory such that there are no name collisions. See ... There it explains that - For Unix and Win32, if a directory ends in two path
                    Message 9 of 14 , May 16, 2013
                    • 0 Attachment
                      On 2013-05-16, ping wrote:
                      > On 5/16/2013 7:28 PM, tooth pik wrote:
                      > >one thing I've found helpful in different circumstances is to set the
                      > >'directory' option in my .vimrc to a single known folder (~/.vim-tmp)
                      > >-- that way all swap files are created in the same place, facilitating
                      > >both recovery and scripting -- I like to make sure there are no
                      > >swapfiles before starting an extensive session
                      > that sounds a good idea, but what will happen if you have two files
                      > in different folders have the same name?
                      > will VIM associate each file with a different swap file name without
                      > confusion?

                      You can specify 'directory' such that there are no name collisions.
                      See

                      :help 'directory'

                      There it explains that

                      - For Unix and Win32, if a directory ends in two path separators "//"
                      or "\\", the swap file name will be built from the complete path to
                      the file with all path separators substituted to percent '%' signs.
                      This will ensure file name uniqueness in the preserve directory.
                      On Win32, when a separating comma is following, you must use "//",
                      since "\\" will include the comma in the file name.

                      For example, this is how I set 'directory' in my ~/.vimrc:

                      if has("win32")
                      set directory=~/tmp/vimswap//,$TMP//,$TEMP//
                      elseif has("unix")
                      set directory=~/tmp/vimswap//,~/.vimswap//,~/tmp//,/var/tmp//,/tmp//
                      else
                      set directory-=.
                      endif

                      I don't know what OS I would ever use other than Windows or Unix,
                      but I don't want to ever create a swap file in any directory other
                      than one I've chosen for that purpose. Doing so would change the
                      modification time of the directory even though I may not have made
                      any other changes to it.

                      Regards,
                      Gary

                      --
                      --
                      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+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • ping
                      ... thanks Gary, that looks nice and self-adaptive I found another one here: https://github.com/docwhat/homedir-vim/blob/master/vimrc/.vimrc it looks more
                      Message 10 of 14 , May 17, 2013
                      • 0 Attachment
                        On 5/17/2013 1:56 AM, Gary Johnson wrote:
                        > On 2013-05-16, ping wrote:
                        >> On 5/16/2013 7:28 PM, tooth pik wrote:
                        >>> one thing I've found helpful in different circumstances is to set the
                        >>> 'directory' option in my .vimrc to a single known folder (~/.vim-tmp)
                        >>> -- that way all swap files are created in the same place, facilitating
                        >>> both recovery and scripting -- I like to make sure there are no
                        >>> swapfiles before starting an extensive session
                        >> that sounds a good idea, but what will happen if you have two files
                        >> in different folders have the same name?
                        >> will VIM associate each file with a different swap file name without
                        >> confusion?
                        > You can specify 'directory' such that there are no name collisions.
                        > See
                        >
                        > :help 'directory'
                        >
                        > There it explains that
                        >
                        > - For Unix and Win32, if a directory ends in two path separators "//"
                        > or "\\", the swap file name will be built from the complete path to
                        > the file with all path separators substituted to percent '%' signs.
                        > This will ensure file name uniqueness in the preserve directory.
                        > On Win32, when a separating comma is following, you must use "//",
                        > since "\\" will include the comma in the file name.
                        >
                        > For example, this is how I set 'directory' in my ~/.vimrc:
                        >
                        > if has("win32")
                        > set directory=~/tmp/vimswap//,$TMP//,$TEMP//
                        > elseif has("unix")
                        > set directory=~/tmp/vimswap//,~/.vimswap//,~/tmp//,/var/tmp//,/tmp//
                        > else
                        > set directory-=.
                        > endif
                        >
                        > I don't know what OS I would ever use other than Windows or Unix,
                        > but I don't want to ever create a swap file in any directory other
                        > than one I've chosen for that purpose. Doing so would change the
                        > modification time of the directory even though I may not have made
                        > any other changes to it.
                        >
                        > Regards,
                        > Gary
                        >

                        thanks Gary, that looks nice and self-adaptive
                        I found another one here:
                        https://github.com/docwhat/homedir-vim/blob/master/vimrc/.vimrc

                        it looks more complex, do you think it is good ?


                        --
                        --
                        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+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • ping
                        ... I think for now there might be no way for me to get that back , since I clearly had this line in my vimrc: setlocal noswapfile disable
                        Message 11 of 14 , May 17, 2013
                        • 0 Attachment
                          On 5/17/2013 1:36 AM, Gary Johnson wrote:
                          > On 2013-05-17, Ping wrote:
                          >
                          >> On May 16, 2013, at 10:41 PM, ping wrote:
                          >>
                          >>> On 5/16/2013 8:48 PM, Gary Johnson wrote:
                          >>>> After a quick look at Vim's memline.c, I think you are the victim of
                          >>>> poor housekeeping and a bug in Vim. You may still be able to
                          >>>> recover your files though.
                          > [...]
                          >
                          >>>> To your problem: It is quite likely that the same directories that
                          >>>> contain files named ".swa" also contain files named ".svz", ".svy",
                          >>>> and so on. Those are valid Vim swap files, but Vim doesn't
                          >>>> recognize them as such by those names.
                          >>>>
                          >>>> I would suggest first verifying that you do not care about the files
                          >>>> matching the pattern ".sw?", then delete them. Then find the newest
                          >>>> file with a name matching the pattern ".s??", rename it to ".swp",
                          >>>> and try recovering it.
                          >>>>
                          >>>> Once you've recovered all your files, I would suggest that you close
                          >>>> all instances of Vim and do a sweep of your file system using find
                          >>>> (not grep) to find all your swap files. Again be sure that you do
                          >>>> not need them, then delete them all. In the future, pay attention
                          >>>> to swap files left over after crashes and keep them cleaned up.
                          >>> thanks Gary, I think I only undertsand some part of your explanations.
                          >>> can you detail the steps for me to recover my file?
                          >> and, I just found that I had the swap file disabled :(
                          > That's unfortunate. Does that mean that you no longer need a better
                          > explanation?
                          >
                          > Regards,
                          > Gary
                          >

                          I think for now there might be no way for me to get that back , since I
                          clearly had this line in my vimrc:

                          setlocal noswapfile "disable swapfile,

                          I think I intentionlly did it for some purpose before .
                          one thing is I don't want to generate all of those aux files in like a
                          system folder .

                          but after reading
                          [more](http://my.opera.com/peterchenadded/blog/2008/12/27/gvim-7-1-swap-and-backup-files)

                          I think I still should have the backup file turned on.

                          backupdir=.,~/tmp,~/

                          so I should still have my backup for unnamed files right?

                          now I learned this good way of putting in a centrollized folder
                          [here](https://github.com/docwhat/homedir-vim/blob/master/vimrc/.vimrc)

                          I just have a thought now, will the backup file remains when we delete
                          the original file? if so maybe we can still recover the whatever files
                          back even if the original ones (even an unnamed buffer? ) got deleted?


                          --
                          --
                          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+unsubscribe@....
                          For more options, visit https://groups.google.com/groups/opt_out.
                        • Gary Johnson
                          ... That approach looks fine to me. Regards, Gary -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text
                          Message 12 of 14 , May 17, 2013
                          • 0 Attachment
                            On 2013-05-17, ping wrote:
                            > On 5/17/2013 1:56 AM, Gary Johnson wrote:
                            > >On 2013-05-16, ping wrote:
                            > >>On 5/16/2013 7:28 PM, tooth pik wrote:
                            > >>>one thing I've found helpful in different circumstances is to set the
                            > >>>'directory' option in my .vimrc to a single known folder (~/.vim-tmp)
                            > >>>-- that way all swap files are created in the same place, facilitating
                            > >>>both recovery and scripting -- I like to make sure there are no
                            > >>>swapfiles before starting an extensive session
                            > >>that sounds a good idea, but what will happen if you have two files
                            > >>in different folders have the same name?
                            > >>will VIM associate each file with a different swap file name without
                            > >>confusion?
                            > >You can specify 'directory' such that there are no name collisions.
                            > >See
                            > >
                            > > :help 'directory'
                            > >
                            > >There it explains that
                            > >
                            > > - For Unix and Win32, if a directory ends in two path separators "//"
                            > > or "\\", the swap file name will be built from the complete path to
                            > > the file with all path separators substituted to percent '%' signs.
                            > > This will ensure file name uniqueness in the preserve directory.
                            > > On Win32, when a separating comma is following, you must use "//",
                            > > since "\\" will include the comma in the file name.
                            > >
                            > >For example, this is how I set 'directory' in my ~/.vimrc:
                            > >
                            > > if has("win32")
                            > > set directory=~/tmp/vimswap//,$TMP//,$TEMP//
                            > > elseif has("unix")
                            > > set directory=~/tmp/vimswap//,~/.vimswap//,~/tmp//,/var/tmp//,/tmp//
                            > > else
                            > > set directory-=.
                            > > endif
                            > >
                            > >I don't know what OS I would ever use other than Windows or Unix,
                            > >but I don't want to ever create a swap file in any directory other
                            > >than one I've chosen for that purpose. Doing so would change the
                            > >modification time of the directory even though I may not have made
                            > >any other changes to it.
                            > >
                            > >Regards,
                            > >Gary
                            > >
                            >
                            > thanks Gary, that looks nice and self-adaptive
                            > I found another one here:
                            > https://github.com/docwhat/homedir-vim/blob/master/vimrc/.vimrc
                            >
                            > it looks more complex, do you think it is good ?

                            That approach looks fine to me.

                            Regards,
                            Gary

                            --
                            --
                            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+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.
                          • Gary Johnson
                            ... For your unnamed buffers, there were no files, so there was nothing to back up. Regards, Gary -- -- You received this message from the vim_use maillist.
                            Message 13 of 14 , May 17, 2013
                            • 0 Attachment
                              On 2013-05-17, ping wrote:
                              > On 5/17/2013 1:36 AM, Gary Johnson wrote:
                              > >On 2013-05-17, Ping wrote:
                              > >
                              > >>On May 16, 2013, at 10:41 PM, ping wrote:
                              > >>
                              > >>>On 5/16/2013 8:48 PM, Gary Johnson wrote:
                              > >>>>After a quick look at Vim's memline.c, I think you are the victim of
                              > >>>>poor housekeeping and a bug in Vim. You may still be able to
                              > >>>>recover your files though.
                              > >[...]
                              > >
                              > >>>>To your problem: It is quite likely that the same directories that
                              > >>>>contain files named ".swa" also contain files named ".svz", ".svy",
                              > >>>>and so on. Those are valid Vim swap files, but Vim doesn't
                              > >>>>recognize them as such by those names.
                              > >>>>
                              > >>>>I would suggest first verifying that you do not care about the files
                              > >>>>matching the pattern ".sw?", then delete them. Then find the newest
                              > >>>>file with a name matching the pattern ".s??", rename it to ".swp",
                              > >>>>and try recovering it.
                              > >>>>
                              > >>>>Once you've recovered all your files, I would suggest that you close
                              > >>>>all instances of Vim and do a sweep of your file system using find
                              > >>>>(not grep) to find all your swap files. Again be sure that you do
                              > >>>>not need them, then delete them all. In the future, pay attention
                              > >>>>to swap files left over after crashes and keep them cleaned up.
                              > >>>thanks Gary, I think I only undertsand some part of your explanations.
                              > >>>can you detail the steps for me to recover my file?
                              > >>and, I just found that I had the swap file disabled :(
                              > >That's unfortunate. Does that mean that you no longer need a better
                              > >explanation?
                              > >
                              > >Regards,
                              > >Gary
                              > >
                              >
                              > I think for now there might be no way for me to get that back ,
                              > since I clearly had this line in my vimrc:
                              >
                              > setlocal noswapfile "disable swapfile,
                              >
                              > I think I intentionlly did it for some purpose before .
                              > one thing is I don't want to generate all of those aux files in like
                              > a system folder .
                              >
                              > but after reading [more](http://my.opera.com/peterchenadded/blog/2008/12/27/gvim-7-1-swap-and-backup-files)
                              >
                              > I think I still should have the backup file turned on.
                              >
                              > backupdir=.,~/tmp,~/
                              >
                              > so I should still have my backup for unnamed files right?

                              For your unnamed buffers, there were no files, so there was nothing
                              to back up.

                              Regards,
                              Gary

                              --
                              --
                              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+unsubscribe@....
                              For more options, visit https://groups.google.com/groups/opt_out.
                            Your message has been successfully submitted and would be delivered to recipients shortly.