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

accidental editing of file

Expand Messages
  • Chandra Amarasingham
    Hi, I am a fairly novice user of vim. One thing I worry about is accidentally changing something on the file without being aware of it by accidental
    Message 1 of 5 , Jan 3, 2014
    • 0 Attachment
      Hi,

      I am a fairly novice user of vim. One thing I worry about is
      accidentally changing something on the file without being aware of it by
      accidental keystrokes, etc.

      Is there an easy way of seeing all the changes which have been made to
      the current file being edited? a "live" diff so to speak?

      Kind Regards,
      Chandra

      --
      --
      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.
    • Ben Fritz
      ... There is a command included in the vimrc_example.vim file distributed with Vim, called :DiffOrig. This command will open a scratch buffer containing the
      Message 2 of 5 , Jan 3, 2014
      • 0 Attachment
        On Friday, January 3, 2014 11:09:44 PM UTC-6, Chandra Amarasingham wrote:
        >
        > I am a fairly novice user of vim. One thing I worry about is
        >
        > accidentally changing something on the file without being aware of it by
        >
        > accidental keystrokes, etc.
        >
        >
        >
        > Is there an easy way of seeing all the changes which have been made to
        >
        > the current file being edited? a "live" diff so to speak?
        >
        >

        There is a command included in the vimrc_example.vim file distributed with Vim, called :DiffOrig.

        This command will open a scratch buffer containing the current on-disk file contents, and diff it with your current unsaved buffer. Then you can see all the changes you've made.

        Alternatively, there are also plugins that just let you know what lines have changed, for example, http://www.vim.org/scripts/script.php?script_id=3052 for changes since you started editing, or http://www.vim.org/scripts/script.php?script_id=4487 for changes since the last commit in your version control system.

        --
        --
        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.
      • Marcin Szamotulski
        ... This is not directly related but it might be helpful as well: there is also gundo plugin which shows undo tree in a nice format.
        Message 3 of 5 , Jan 4, 2014
        • 0 Attachment
          On 23:07 Fri 03 Jan , Ben Fritz wrote:
          > On Friday, January 3, 2014 11:09:44 PM UTC-6, Chandra Amarasingham wrote:
          > >
          > > I am a fairly novice user of vim. One thing I worry about is
          > >
          > > accidentally changing something on the file without being aware of it by
          > >
          > > accidental keystrokes, etc.
          > >
          > >
          > >
          > > Is there an easy way of seeing all the changes which have been made to
          > >
          > > the current file being edited? a "live" diff so to speak?
          > >
          > >
          >
          > There is a command included in the vimrc_example.vim file distributed with Vim, called :DiffOrig.
          >
          > This command will open a scratch buffer containing the current on-disk file contents, and diff it with your current unsaved buffer. Then you can see all the changes you've made.
          >
          > Alternatively, there are also plugins that just let you know what lines have changed, for example, http://www.vim.org/scripts/script.php?script_id=3052 for changes since you started editing, or http://www.vim.org/scripts/script.php?script_id=4487 for changes since the last commit in your version control system.
          >


          This is not directly related but it might be helpful as well: there is also gundo plugin which shows undo tree in a nice format.
          http://sjl.bitbucket.org/gundo.vim/

          Best regards,
          Marcin

          --
          --
          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.
        • Chandra Amarasingham
          Thanks Marcin and Ben. Chandra ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
          Message 4 of 5 , Jan 6, 2014
          • 0 Attachment
            Thanks Marcin and Ben.
            Chandra

            On 01/04/2014 08:49 PM, Marcin Szamotulski wrote:
            > On 23:07 Fri 03 Jan , Ben Fritz wrote:
            >> On Friday, January 3, 2014 11:09:44 PM UTC-6, Chandra Amarasingham wrote:
            >>> I am a fairly novice user of vim. One thing I worry about is
            >>>
            >>> accidentally changing something on the file without being aware of it by
            >>>
            >>> accidental keystrokes, etc.
            >>>
            >>>
            >>>
            >>> Is there an easy way of seeing all the changes which have been made to
            >>>
            >>> the current file being edited? a "live" diff so to speak?
            >>>
            >>>
            >> There is a command included in the vimrc_example.vim file distributed with Vim, called :DiffOrig.
            >>
            >> This command will open a scratch buffer containing the current on-disk file contents, and diff it with your current unsaved buffer. Then you can see all the changes you've made.
            >>
            >> Alternatively, there are also plugins that just let you know what lines have changed, for example, http://www.vim.org/scripts/script.php?script_id=3052 for changes since you started editing, or http://www.vim.org/scripts/script.php?script_id=4487 for changes since the last commit in your version control system.
            >>
            >
            > This is not directly related but it might be helpful as well: there is also gundo plugin which shows undo tree in a nice format.
            > http://sjl.bitbucket.org/gundo.vim/
            >
            > Best regards,
            > Marcin
            >

            --
            --
            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.
          • David Fishburn
            On Sat, Jan 4, 2014 at 12:09 AM, Chandra Amarasingham
            Message 5 of 5 , Jan 6, 2014
            • 0 Attachment
              On Sat, Jan 4, 2014 at 12:09 AM, Chandra Amarasingham <camarasingham@...> wrote:
              Hi,

              I am a fairly novice user of vim.  One thing I worry about is accidentally changing something on the file without being aware of it by accidental keystrokes, etc.

              You can also issue:
              :set readonly

              To prevent you from saving the file if you have changed it.

              HTH,
              David 

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