scrolloff enhancement wish

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

scrolloff enhancement wish

iler.ml
Hello Bram,
Would you include into todo.txt the thing that I used
in one very ancient but exceptionally smooth editor called K52
(it worked on pdp11, vt52 terminals).

This editor always positioned cursor at 2/3 height from top of screen.
This worked surprisingly well, even if it sounds strange. I worked
couple of years with this editor and this felt very comfortable.

How about adding the option 'scrollfix'  [to the todo.txt],  which
would fix the cursor on fixed line, in percantage 0-100.
Value ':set scrollfix=50' would work like ':set scrolloff=999'.
Value ':set scrollfix=67' would fix cursor 2/3 from top of screen.
Value ':set scrolloff=0' would keep cursor at top line of screen.
Value ':set scrolloff=100' would keep cursor at bottom line of screen.

Would you put this into todo.txt ?

Yakov
Reply | Threaded
Open this post in threaded view
|

Re: scrolloff enhancement wish

Bram Moolenaar

Yakov Lerner wrote:

> Would you include into todo.txt the thing that I used
> in one very ancient but exceptionally smooth editor called K52
> (it worked on pdp11, vt52 terminals).
>
> This editor always positioned cursor at 2/3 height from top of screen.
> This worked surprisingly well, even if it sounds strange. I worked
> couple of years with this editor and this felt very comfortable.
>
> How about adding the option 'scrollfix'  [to the todo.txt],  which
> would fix the cursor on fixed line, in percantage 0-100.
> Value ':set scrollfix=50' would work like ':set scrolloff=999'.
> Value ':set scrollfix=67' would fix cursor 2/3 from top of screen.
> Value ':set scrolloff=0' would keep cursor at top line of screen.
> Value ':set scrolloff=100' would keep cursor at bottom line of screen.
>
> Would you put this into todo.txt ?

As you say, you can already do most of this by setting 'scrolloff' to
a large number.

If the cursor is really fixed at one position then using "j" would mean
that the cursor remains in the same position and the text scrolls.
That goes against what most people expect.  I think it's not all that
useful.  And we have too many options already...

--
hundred-and-one symptoms of being an internet addict:
33. You name your children Eudora, Mozilla and Dotcom.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
Reply | Threaded
Open this post in threaded view
|

Re: scrolloff enhancement wish

Matthew Winn
On Fri, Jul 21, 2006 at 10:02:10AM +0200, Bram Moolenaar wrote:

>
> Yakov Lerner wrote:
> > How about adding the option 'scrollfix'  [to the todo.txt],  which
> > would fix the cursor on fixed line, in percantage 0-100.
> > Value ':set scrollfix=50' would work like ':set scrolloff=999'.
> > Value ':set scrollfix=67' would fix cursor 2/3 from top of screen.
> > Value ':set scrolloff=0' would keep cursor at top line of screen.
> > Value ':set scrolloff=100' would keep cursor at bottom line of screen.
>
> As you say, you can already do most of this by setting 'scrolloff' to
> a large number.
>
> If the cursor is really fixed at one position then using "j" would mean
> that the cursor remains in the same position and the text scrolls.
> That goes against what most people expect.  I think it's not all that
> useful.

I've had some situations where such a feature would be useful.

A few weeks ago I was working with a large file containing many long SQL
statements mixed in amongst other stuff.  I was searching for the start
of each statement, and it would have been very useful if I could have
arranged it so that each search resulted in the cursor appearing a couple
of lines from the the top of the screen with the SQL statement filling
the space below it.

In this case I set scrolloff to 100 so the start of each SQL statement
was centred, but that gave me half a screen of context above the cursor
when only two or three lines would have done, and caused the ends of the
longest SQL statements to disappear below the bottom of the screen.

I suppose there might be some way to map all the movement commands to
reposition the current line to a certain place on the screen, but at the
time I was doing all this it was quicker to scroll the text each time
than it would have been to write all the necessary mappings.

> And we have too many options already...

Too many options?  Is that possible?

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: scrolloff enhancement wish

Nico Weber-3
Hi,
> Too many options? Is that possible?
Obviously ;-)

As you said, you can probably write a keymapping that does what you want
(:map <F1> <C-e>j might do what you want if I understood you correctly).

Bye,
Nico

Reply | Threaded
Open this post in threaded view
|

Re: scrolloff enhancement wish

Hari Krishna Dara
In reply to this post by iler.ml

On Fri, 21 Jul 2006 at 9:23am, Matthew Winn wrote:

> On Fri, Jul 21, 2006 at 10:02:10AM +0200, Bram Moolenaar wrote:
> >
> > Yakov Lerner wrote:
> > > How about adding the option 'scrollfix'  [to the todo.txt],  which
> > > would fix the cursor on fixed line, in percantage 0-100.
> > > Value ':set scrollfix=50' would work like ':set scrolloff=999'.
> > > Value ':set scrollfix=67' would fix cursor 2/3 from top of screen.
> > > Value ':set scrolloff=0' would keep cursor at top line of screen.
> > > Value ':set scrolloff=100' would keep cursor at bottom line of screen.
> >
> > As you say, you can already do most of this by setting 'scrolloff' to
> > a large number.
> >
> > If the cursor is really fixed at one position then using "j" would mean
> > that the cursor remains in the same position and the text scrolls.
> > That goes against what most people expect.  I think it's not all that
> > useful.
>
> I've had some situations where such a feature would be useful.
>
> A few weeks ago I was working with a large file containing many long SQL
> statements mixed in amongst other stuff.  I was searching for the start
> of each statement, and it would have been very useful if I could have
> arranged it so that each search resulted in the cursor appearing a couple
> of lines from the the top of the screen with the SQL statement filling
> the space below it.
>
> In this case I set scrolloff to 100 so the start of each SQL statement
> was centred, but that gave me half a screen of context above the cursor
> when only two or three lines would have done, and caused the ends of the
> longest SQL statements to disappear below the bottom of the screen.
>
> I suppose there might be some way to map all the movement commands to
> reposition the current line to a certain place on the screen, but at the
> time I was doing all this it was quicker to scroll the text each time
> than it would have been to write all the necessary mappings.

It might be easier to use the CursorMoved autocommand to reposition the
line than making a bunch of autocommands.

--
HTH,
Hari

>
> > And we have too many options already...
>
> Too many options?  Is that possible?
>
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: scrolloff enhancement wish

scott-268
In reply to this post by Matthew Winn
On Fri, 2006-07-21 at 09:23 +0100, Matthew Winn wrote:
> On Fri, Jul 21, 2006 at 10:02:10AM +0200, Bram Moolenaar wrote:
> > Yakov Lerner wrote:

> I suppose there might be some way to map all the movement commands to
> reposition the current line to a certain place on the screen, but at the
> time I was doing all this it was quicker to scroll the text each time
> than it would have been to write all the necessary mappings.


:nmap n nzz

see if you like that