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

Re: [BugReport] Mark deletion doesnt persist between Vim sessions

Expand Messages
  • Ilya Esteban
    Thanks for the clarification. I think it would make sense to change the behavior so that when exiting Vim the viminfo file just saves all the currently active
    Message 1 of 10 , Feb 6 9:23 AM
    • 0 Attachment
      Thanks for the clarification. I think it would make sense to change the behavior so that when exiting Vim the viminfo file just saves all the currently active marks, rather than the union of the current marks + all the deleted marks.

      Two reasons:

      1) All files with marks get loaded into hidden buffers on startup. So if you have a bunch of files you once marked, they will keep getting loaded even if you dont need them anymore (with the additional side-effect that any new buffers you create during your session start with a double digit ID number)

      2) If you use a plugin or a customization that visually shows the marks, you end up with visual garbage in your files (the old tags), that you cant get rid of unless you delete viminfo or reuse the marks in a different file.

      -Ilya

      On Wednesday, February 6, 2013 3:33:35 AM UTC-8, Bram Moolenaar wrote:

      > The mark is stored in the viminfo file. When exiting Vim the current
      >
      > marks and the ones in the viminfo file are merged. You can see this if
      >
      > you set the mark elsewhere, then delete it, after restarting Vim you get
      >
      > the old position.
      >
      >
      >
      > Only way to really remove it is by editing the viminfo file.
      >
      > Or you can start vim with "-u NONE" to avoid using the viminfo file.
      >
      >
      >
      > - Bram
      >

      --
      --
      You received this message from the "vim_dev" 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_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ben Fritz
      ... No. The whole point of saving marks in .viminfo is that when you edit the file again you will see the marks. If you save your file with marks, quit Vim,
      Message 2 of 10 , Feb 6 9:48 AM
      • 0 Attachment
        On Wednesday, February 6, 2013 11:23:34 AM UTC-6, Ilya Esteban wrote:
        > Thanks for the clarification. I think it would make sense to change the behavior so that when exiting Vim the viminfo file just saves all the currently active marks, rather than the union of the current marks + all the deleted marks.
        >
        > Two reasons:
        >
        > 1) All files with marks get loaded into hidden buffers on startup. So if you have a bunch of files you once marked, they will keep getting loaded even if you dont need them anymore (with the additional side-effect that any new buffers you create during your session start with a double digit ID number)
        >
        > 2) If you use a plugin or a customization that visually shows the marks, you end up with visual garbage in your files (the old tags), that you cant get rid of unless you delete viminfo or reuse the marks in a different file.
        >

        No. The whole point of saving marks in .viminfo is that when you edit the file again you will see the marks. If you save your file with marks, quit Vim, launch Vim to edit a completely different file, :wq, then load your first file again, under your proposal the marks would be gone.

        If you actually want this, then you could very easily (pseudocode):

        autocmd VimEnter {set 'viminfo' option to not save marks}
        autocmd VimEnter {force-create the .viminfo file}
        autocmd VimEnter {restore the 'viminfo' option to save marks again}

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Bram Moolenaar
        Ilya Esteban wrote: [reordered] ... That doesn t work if you have multiple Vim programs running and they exit in any order. A mark set in one Vim would be
        Message 3 of 10 , Feb 6 9:53 AM
        • 0 Attachment
          Ilya Esteban wrote:

          [reordered]

          > On Wednesday, February 6, 2013 3:33:35 AM UTC-8, Bram Moolenaar wrote:
          >
          > > The mark is stored in the viminfo file. When exiting Vim the current
          > >
          > > marks and the ones in the viminfo file are merged. You can see this if
          > >
          > > you set the mark elsewhere, then delete it, after restarting Vim you get
          > >
          > > the old position.
          > >
          > >
          > >
          > > Only way to really remove it is by editing the viminfo file.
          > >
          > > Or you can start vim with "-u NONE" to avoid using the viminfo file.
          >
          > Thanks for the clarification. I think it would make sense to change
          > the behavior so that when exiting Vim the viminfo file just saves all
          > the currently active marks, rather than the union of the current marks
          > + all the deleted marks.

          That doesn't work if you have multiple Vim programs running and they
          exit in any order. A mark set in one Vim would be removed by a Vim that
          exits later.

          > Two reasons:
          >
          > 1) All files with marks get loaded into hidden buffers on startup. So
          > if you have a bunch of files you once marked, they will keep getting
          > loaded even if you dont need them anymore (with the additional
          > side-effect that any new buffers you create during your session start
          > with a double digit ID number)

          I wonder who does this, doesn't happen for me.

          > 2) If you use a plugin or a customization that visually shows the
          > marks, you end up with visual garbage in your files (the old tags),
          > that you cant get rid of unless you delete viminfo or reuse the marks
          > in a different file.

          Solving this properly would require storing the time when a mark was set
          and when it was deleted. That's a bit complicated. A simple workaround
          is to set the mark in a file that you don't use.

          --
          ARTHUR: No, hang on! Just answer the five questions ...
          GALAHAD: Three questions ...
          ARTHUR: Three questions ... And we shall watch ... and pray.
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ an exciting new programming language -- http://www.Zimbu.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          --
          You received this message from the "vim_dev" 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_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Christian Brabandt
          Hi Ilya! [please reformat your lines to some 70 chars] ... I wonder why this happens. What is your viminfo option set to? Could it be, it includes the % item
          Message 4 of 10 , Feb 6 10:05 AM
          • 0 Attachment
            Hi Ilya!

            [please reformat your lines to some 70 chars]

            On Mi, 06 Feb 2013, Ilya Esteban wrote:

            > 1) All files with marks get loaded into hidden buffers on startup. So if you have a bunch of files you once marked, they will keep getting loaded even if you dont need them anymore (with the additional side-effect that any new buffers you create during your session start with a double digit ID number)

            I wonder why this happens. What is your 'viminfo' option set to? Could
            it be, it includes the % item and thus restoring the buffer list on
            startup (though this is not exactly the same as what you see).


            Mit freundlichen Grüßen
            Christian
            --
            Was die neuen Unwissenden holen müssen:
            Feilenfett

            --
            --
            You received this message from the "vim_dev" 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_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Roland Eggner
            ... grep -C1 wviminfo /etc/vim/vimrc ... to write ALL changes to .viminfo, e.g. deletion of text marks, following wviminfo! is REQUIRED: au VimLeavePre *
            Message 5 of 10 , Feb 6 2:32 PM
            • 0 Attachment
              On 2013-02-06 Wednesday at 09:23 -0800 Ilya Esteban wrote:
              > On Wednesday, February 6, 2013 3:33:35 AM UTC-8, Bram Moolenaar wrote:
              > > The mark is stored in the viminfo file. When exiting Vim the current
              > > marks and the ones in the viminfo file are merged. You can see this if
              > > you set the mark elsewhere, then delete it, after restarting Vim you get
              > > the old position.
              > >
              > > Only way to really remove it is by editing the viminfo file.
              > > Or you can start vim with "-u NONE" to avoid using the viminfo file.
              > Thanks for the clarification. I think it would make sense to change the behavior so that when exiting Vim the viminfo file just saves all the currently active marks, rather than the union of the current marks + all the deleted marks.
              >
              > Two reasons:
              >
              > 1) All files with marks get loaded into hidden buffers on startup. So if you have a bunch of files you once marked, they will keep getting loaded even if you dont need them anymore (with the additional side-effect that any new buffers you create during your session start with a double digit ID number)
              >
              > 2) If you use a plugin or a customization that visually shows the marks, you end up with visual garbage in your files (the old tags), that you cant get rid of unless you delete viminfo or reuse the marks in a different file.

              grep -C1 wviminfo /etc/vim/vimrc
              --------------------------------

              " to write ALL changes to .viminfo, e.g. deletion of text marks, following wviminfo! is REQUIRED:
              au VimLeavePre * wviminfo!

              " viminfo „metadata“ e.g. textmarks are ONLY useful if in sync with related „content“, thus when writing edited files write viminfo SIMULTANEOUSLY.
              au BufWritePost * wviminfo!


              --
              Roland Eggner
            • Charles Campbell
              ... There s also :delmarks ex. au VImEnter * delmarks A-Z Regards, C Campbell -- -- You received this message from the vim_dev maillist. Do not top-post!
              Message 6 of 10 , Feb 8 11:24 AM
              • 0 Attachment
                Bram Moolenaar wrote:
                > Ilya Esteban wrote:
                >
                > [snip]
                >
                >> 2) If you use a plugin or a customization that visually shows the
                >> marks, you end up with visual garbage in your files (the old tags),
                >> that you cant get rid of unless you delete viminfo or reuse the marks
                >> in a different file.
                > Solving this properly would require storing the time when a mark was set
                > and when it was deleted. That's a bit complicated. A simple workaround
                > is to set the mark in a file that you don't use.
                >
                There's also :delmarks

                ex. au VImEnter * delmarks A-Z

                Regards,
                C Campbell

                --
                --
                You received this message from the "vim_dev" 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_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+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.