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

vim: how to stop vim from generating ANY additional files?

Expand Messages
  • ping
    the question is in the subject, I ve been with VIM daily for quite a while and I normally is OK with it. but I just reallized it s not good if I generate a lot
    Message 1 of 7 , Feb 16, 2013
    View Source
    • 0 Attachment
      the question is in the subject, I've been with VIM daily for quite a
      while and I normally is OK with it.
      but I just reallized it's not good if I generate a lot of additional
      files when I change some config file in my linux FS.
      typically they are sth like:

      asciidoctips.txt~
      .asciidoctips.txt.un~

      .pers-notes.txt.swh
      .pers-notes.txt.swi
      .pers-notes.txt.swj
      .pers-notes.txt.swk
      .pers-notes.txt.swl
      .pers-notes.txt.swm
      .pers-notes.txt.swn
      .pers-notes.txt.swo
      .tech-tips2.txt.swp

      just want to confirm, to make sure there is not a single additonal file
      generated by vim under all circumstances, are following settings sufficient?

      set nobackup
      set noudf

      thanks!

      --
      --
      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.
    • John Little
      ... Those are backup files. The file you are editing is renamed to something like this before the new version is written. ... Those are all swap files. The
      Message 2 of 7 , Feb 16, 2013
      View Source
      • 0 Attachment
        On Sunday, February 17, 2013 4:01:10 PM UTC+13, ping wrote:
        > typically they are sth like:
        >
        > asciidoctips.txt~
        > .asciidoctips.txt.un~
        Those are backup files. The file you are editing is renamed to something like this before the new version is written.

        > .pers-notes.txt.swh
        > .pers-notes.txt.swi
        > .pers-notes.txt.swj
        > .pers-notes.txt.swk
        > .pers-notes.txt.swl
        > .pers-notes.txt.swm
        > .pers-notes.txt.swn
        > .pers-notes.txt.swo
        > .tech-tips2.txt.swp

        Those are all swap files. The fact that there are many for .pers-notes.txt implies that vim has been killed or crashed a lot. Normally, swap files are deleted when vim exits cleanly.

        > just want to confirm, to make sure there is not a single additonal file
        > generated by vim under all circumstances, are following settings sufficient?
        >
        > set nobackup
        > set noudf

        In principle, you'd want set noswf as well, but I think your approach is ... well, would "foolhardy" be acceptable? Perhaps "risky" is better. These backup and swap files protect against losing your files. One doesn't need them often, but I've been very glad on several occasions. Undo files are off by default.

        You shouldn't be getting stray swap files, it's much preferable to work out why vim is dying and fix it. Note that after vim does die, on the next restart vim warns you about the problem but is reluctant to delete the file, you may have to manually delete it.

        Backup files are IMO better tamed using the backupdir option to put them in a central place.

        Regards, John Little

        --
        --
        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 understood, thanks for reminding. I won t turn them off in my daily work. but I just want to have a quick/neat way to turn them off in SOME scenarios .
        Message 3 of 7 , Feb 17, 2013
        View Source
        • 0 Attachment
          On 2/16/2013 10:54 PM, John Little wrote:
          > In principle, you'd want set noswf as well, but I think your approach is ... well, would "foolhardy" be acceptable? Perhaps "risky" is better. These backup and swap files protect against losing your files. One doesn't need them often, but I've been very glad on several occasions. Undo files are off by default.
          >
          > You shouldn't be getting stray swap files, it's much preferable to work out why vim is dying and fix it. Note that after vim does die, on the next restart vim warns you about the problem but is reluctant to delete the file, you may have to manually delete it.
          I understood, thanks for reminding.
          I won't turn them off in my daily work.
          but I just want to have a quick/neat way to turn them off in SOME
          scenarios .
          so my current method is to define following map

          "no additonal files
          nn ,nf <esc>:set nobackup<CR>:set noudf<CR>:set noswp<CR>

          so right after I started a new vim before I open any system config file,
          I quickly type ",nf" to turn off any additional file generations.
          >
          > Backup files are IMO better tamed using the backupdir option to put them in a central place.
          this looks good, but what if you have 2 files from different folders
          sharing the same name?

          --
          --
          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
          ... that isn t a problem for backupdir -- it munges a swapfile name that includes the path sc -- -- You received this message from the vim_use maillist. Do
          Message 4 of 7 , Feb 17, 2013
          View Source
          • 0 Attachment
            On Sun, Feb 17, 2013 at 09:30:32AM -0500, ping wrote:
            > On 2/16/2013 10:54 PM, John Little wrote:
            > >
            > >Backup files are IMO better tamed using the backupdir option to put them in a central place.
            > this looks good, but what if you have 2 files from different folders
            > sharing the same name?

            that isn't a problem for 'backupdir' -- it munges a swapfile name that
            includes the path

            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.
          • ping
            really? this is cool then. I m thinking to give it a trial. thanks! regards ping ... -- -- You received this message from the vim_use maillist. Do not
            Message 5 of 7 , Feb 17, 2013
            View Source
            • 0 Attachment
              really? this is cool then.
              I'm thinking to give it a trial.

              thanks!
              regards
              ping

              On 2/17/2013 12:00 PM, tooth pik wrote:
              > On Sun, Feb 17, 2013 at 09:30:32AM -0500, ping wrote:
              >> On 2/16/2013 10:54 PM, John Little wrote:
              >>> Backup files are IMO better tamed using the backupdir option to put them in a central place.
              >> this looks good, but what if you have 2 files from different folders
              >> sharing the same name?
              > that isn't a problem for 'backupdir' -- it munges a swapfile name that
              > includes the path
              >
              > 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.
            • John Little
              ... That last word should be noswf . I presume that s a typo, or you d get an error message. Regards, John -- -- You received this message from the vim_use
              Message 6 of 7 , Feb 17, 2013
              View Source
              • 0 Attachment
                On Monday, February 18, 2013 3:30:32 AM UTC+13, ping wrote:
                > nn ,nf <esc>:set nobackup<CR>:set noudf<CR>:set noswp<CR>

                That last word should be "noswf".
                I presume that's a typo, or you'd get an error message.

                Regards, John

                --
                --
                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 its typo, thanks! -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For
                Message 7 of 7 , Feb 17, 2013
                View Source
                • 0 Attachment
                  On 2/17/2013 3:48 PM, John Little wrote:
                  > On Monday, February 18, 2013 3:30:32 AM UTC+13, ping wrote:
                  >> nn ,nf <esc>:set nobackup<CR>:set noudf<CR>:set noswp<CR>
                  > That last word should be "noswf".
                  > I presume that's a typo, or you'd get an error message.
                  >
                  > Regards, John
                  >
                  yes its typo, thanks!

                  --
                  --
                  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.