On 2021-03-12, DieSpinne wrote:
> Thanks Gary, I follow you there. I have recently switched from the 
> tab-centered
> to the buffer-centered approach to Vim and went through those clarifications,
> sorry if I still slip on some details.
> 
> If one understands Vim fundamentals, it is indeed a bit naive to assume the
> behavior I'm requesting when switching buffers. But I don't think there is 
> much
> dispute on that leaving the viewport in place (or, rather, restoring it to the
> original offset) is the expected thing to happen when returning to a buffer, 
> as
> one has to reorient himself otherwise.
> 
> In my opinion, this is another potential reason why novice users may fall to
> the one file = one tab trap. They observe the behavior they expect on tabs, so
> they stick to them. I think this proposal would be a nice addition, but I 
> don't
> want to be pressing here, I'm just trying to make my point clear.

It's interesting how different people use Vim so differently.
I hardly ever use any of the buffer commands and am only starting to
use tabs more regularly.  I usually keep all the buffers I'm using
open in different windows, in different horizontal and vertical
splits.  I've also used the Rolodex technique.  I usually have Vim
occupying a full monitor, so I have plenty of space for windows.

I also use quickfix lists to jump among files in a single window,
but I don't edit more than one of those files at a time, so the
repositioning of the view into the file as I jump in the quickfix
list has never bothered me.

As I understand your issue, you'd like buffers to remember how they
were last viewed.  The problem, of course, is that each buffer can
be viewed in multiple windows so the way they were last viewed
depends on the window in which they're being re-opened.

So perhaps you could create a window-local variable as a list of
dictionaries, one dictionary for each buffer opened in that window,
with each dictionary containing the top line and the cursor line of
the buffer when last viewed in that window.  A set of autocommands
could manage that list and restore a buffer's view when re-opened in
that window.

Alternatively, you could create a couple of buffer-local variables
containing the top line and cursor line of the last window to view
that buffer.  Then whenever a buffer is re-opened in a window, it is
displayed as it was last viewed.  If the user is using only one or
a few windows, and never views a buffer in more than one window at
a time, this should work fine.  Again, this would all be managed
with a few autocommands.

Assuming that all works and meets your expectations, the problem
becomes how to make novice users aware of the plugin.

Just some thoughts.

Regards,
Gary

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20210312230430.GF4087%40phoenix.

Raspunde prin e-mail lui