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 via email to