Saturday, August 24, 2024

Re: Annoying Vim Problem

On Sat, Aug 24, 2024 at 3:22 PM Riza Dindir <riza.dindir@gmail.com> wrote:
>
> Hello
>
> When I switch from one buffer to the other, the buffer that I have switched to is changed so that a previous edit is being replayed. To explain a bit more.
>
> I have a file a.txt and edited that file (changing first 2 characters characters in line 2 to uppercase)
>
> file: a.txt
>
> line 1
> LIne 2
>
> I switch to some other buffer (or close the editor and open it again) , do some editing and come back to buffer a.txt. When I do that the first 2 characters on line 2 are lowercase.
>
> This has been bothering me for a while now. Has anybody seen this kind of behavior before? Does this have something to do with the .viminfo file maybe.
>
> Regards

I think it has to do with how you leave a.txt. If either you haven't
set 'autowrite' or 'autowriteall', or you quit it with an exclamation
mark (:q! to quit Vim or :e! b.txt to edit b.txt in the window where
you had edited a.txt) then any changes in a.txt are lost. If you quit
a.txt without an exclamation mark, then Vim may save the contents
depending on the settings of 'autowrite' and 'autowriteall', or else
it will refuse to leave a.txt with a mesage telling you that you want
to abandon the changes (i.e. lose them) you can repeat the command
with an exclamation mark; but beware that if you do, any unsaved
changes in a.txt will be lost.

Best regards,
Tony.

--
--
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@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXv3ruY0PjhAaVag9TrryLtfEotp%2BENB3PRQ%3Do5UcqJEiQ%40mail.gmail.com.

No comments:

Post a Comment