Friday, January 20, 2023

Re: Why does (my) Vim leave the cursor to the last mark even if I don't save the file?

On Fr, 20 Jan 2023, 'Ottavio Caruso' via vim_use wrote:

> Am 19/01/2023 um 16:40 schrieb Christian Brabandt:
> > On Do, 19 Jan 2023, 'Ottavio Caruso' via vim_use wrote:
> > > $ cat .vim/vimrc
> > > source $VIMRUNTIME/defaults.vim
> > This is where the auto command is defined. If you do not want it, you
> > can delete this after sourcing the defauls.vim file:
> >
> > :augroup vimStartup | au! | augroup END
>
> Thanks, but if do that, I'd then remove this feature from all files, whether
> edited or not, wouldn't I?. Is it possible to have this implemented only on
> files that are saved?

I would find it inconsistent for somtimes jumping to a different spot in
a file and sometimes not. I might not even remember if I last time saved
that particular file or not (e.g. I just need to check something but did
not save the file). That might be confusing.

It might be possible to change that behaviour using a custom function
(e.g. set a flag on BufWritePost, check that flag on a BufLeave
autocomamnd and set the '" mark accordingly). Not sure if this will work
or not.

Mit freundlichen Grüßen
Christian
--
Herr, du hast mir das Können genommen, so nimm mir auch noch das Wollen.

--
--
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/20230120103943.GE1041827%40256bit.org.

No comments:

Post a Comment