Scrolling the buffer iso through the window

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

Scrolling the buffer iso through the window

Eric Leenman
Hi,

I don't if the terminologie is correct, but is it possible to scroll the
buffer iso of window.

When I press <arrow down> or <page down> my cursor stays where it was in
the window, but the buffer moves one up.
So that my eyes are always at the same row of the screen?

To make it more visual;
Say for example that my view screen looks like below:

+----------------------+ <-vim window
|void main()           |
|{                     |
|.int a;...............|  .. = line with cursor
| int b;               |
| int c;               |
|+---------------------+

And then I press <arrow down> and then my view screen looks like:

+----------------------+ <-vim window
|{                     |
| int a;               |  
|.int b;...............|  .. = line with cursor
| int c;               |
| int d;               |
|+---------------------+

And then I press <arrow down> again and then my view screen looks like:

+----------------------+ <-vim window
| int a;               |  
| int b;               |
|.int c;...............|  .. = line with cursor
| int d;               |
| Foo(100)             |
|+---------------------+

Thx in advance

Rgds,
Eric


Disclaimer; The information contained in this communication is confidential
and may be legally privileged. It is intended solely for the use of the individual
or entity to whom it is addressed and others authorized to recieve it.
Use of this information, in whatever way, by others is strictly prohibited
and may be unlawful. GREEFA does not accept legal responsibility
for this e-mail message due to the insecure nature of internet
communications.  
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling the buffer iso through the window

Gareth Oakes-2
I don't know if there's an easier way, but you can simulate this effect
by remapping the up/down arrows and the "zz" command, eg.

:nnoremap <Up> zz<Up>
:nnoremap <Down> zz<Down>

See ":help map" for more information on remapping, including the other
modes you will probably want to remap those keystrokes for.

Cheers,
-G

Eric Leenman wrote:

> Hi,
>
> I don't if the terminologie is correct, but is it possible to scroll the
> buffer iso of window.
>
> When I press <arrow down> or <page down> my cursor stays where it was in
> the window, but the buffer moves one up.
> So that my eyes are always at the same row of the screen?
>
> To make it more visual;
> Say for example that my view screen looks like below:
>
> +----------------------+ <-vim window
> |void main()           |
> |{                     |
> |.int a;...............|  .. = line with cursor
> | int b;               |
> | int c;               |
> |+---------------------+
>
> And then I press <arrow down> and then my view screen looks like:
>
> +----------------------+ <-vim window
> |{                     |
> | int a;               |  
> |.int b;...............|  .. = line with cursor
> | int c;               |
> | int d;               |
> |+---------------------+
>
> And then I press <arrow down> again and then my view screen looks like:
>
> +----------------------+ <-vim window
> | int a;               |  
> | int b;               |
> |.int c;...............|  .. = line with cursor
> | int d;               |
> | Foo(100)             |
> |+---------------------+
>
> Thx in advance
>
> Rgds,
> Eric
>
>
> Disclaimer; The information contained in this communication is confidential
> and may be legally privileged. It is intended solely for the use of the individual
> or entity to whom it is addressed and others authorized to recieve it.
> Use of this information, in whatever way, by others is strictly prohibited
> and may be unlawful. GREEFA does not accept legal responsibility
> for this e-mail message due to the insecure nature of internet
> communications.  

Reply | Threaded
Open this post in threaded view
|

Re: Scrolling the buffer iso through the window

Dominic Evans
In reply to this post by Eric Leenman
I think you're asking for the cursor to stay always fixed in the
middle of the window

:set scrolloff=999

read :help scrolloff and see if that is actually what you want

Cheers,
Dominic

On 15/09/05, Eric Leenman <[hidden email]> wrote:

> Hi,
>
> I don't if the terminologie is correct, but is it possible to scroll the
> buffer iso of window.
>
> When I press <arrow down> or <page down> my cursor stays where it was in
> the window, but the buffer moves one up.
> So that my eyes are always at the same row of the screen?
>
> To make it more visual;
> Say for example that my view screen looks like below:
>
> +----------------------+ <-vim window
> |void main()           |
> |{                     |
> |.int a;...............|  .. = line with cursor
> | int b;               |
> | int c;               |
> |+---------------------+
>
> And then I press <arrow down> and then my view screen looks like:
>
> +----------------------+ <-vim window
> |{                     |
> | int a;               |
> |.int b;...............|  .. = line with cursor
> | int c;               |
> | int d;               |
> |+---------------------+
>
> And then I press <arrow down> again and then my view screen looks like:
>
> +----------------------+ <-vim window
> | int a;               |
> | int b;               |
> |.int c;...............|  .. = line with cursor
> | int d;               |
> | Foo(100)             |
> |+---------------------+
>
> Thx in advance
>
> Rgds,
> Eric
>
>
> Disclaimer; The information contained in this communication is confidential
> and may be legally privileged. It is intended solely for the use of the individual
> or entity to whom it is addressed and others authorized to recieve it.
> Use of this information, in whatever way, by others is strictly prohibited
> and may be unlawful. GREEFA does not accept legal responsibility
> for this e-mail message due to the insecure nature of internet
> communications.
>
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling the buffer iso through the window

James Vega-3
In reply to this post by Eric Leenman
On Thu, Sep 15, 2005 at 04:20:51PM +0200, Eric Leenman wrote:
> Hi,
>
> I don't if the terminologie is correct, but is it possible to scroll the
> buffer iso of window.
>
> When I press <arrow down> or <page down> my cursor stays where it was in
> the window, but the buffer moves one up.
> So that my eyes are always at the same row of the screen?

The 'scrolloff' option is what you're looking for.  That controls how
many lines above and below the cursor are kept on the screen.  Setting
this to a large number will mean that your cursor will always be in the
middle of the window.

James
--
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[hidden email]>

attachment0 (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling the buffer iso through the window

Gareth Oakes-2
In reply to this post by Eric Leenman
See previous posting, I just realised a mistake - the "zz" should come
AFTER the <Up> or <Down>, eg.

:nnoremap <Up> <Up>zz
:nnoremap <Down> <Down>zz


Cheers,
-G

Eric Leenman wrote:

> Hi,
>
> I don't if the terminologie is correct, but is it possible to scroll the
> buffer iso of window.
>
> When I press <arrow down> or <page down> my cursor stays where it was in
> the window, but the buffer moves one up.
> So that my eyes are always at the same row of the screen?
>
> To make it more visual;
> Say for example that my view screen looks like below:
>
> +----------------------+ <-vim window
> |void main()           |
> |{                     |
> |.int a;...............|  .. = line with cursor
> | int b;               |
> | int c;               |
> |+---------------------+
>
> And then I press <arrow down> and then my view screen looks like:
>
> +----------------------+ <-vim window
> |{                     |
> | int a;               |  
> |.int b;...............|  .. = line with cursor
> | int c;               |
> | int d;               |
> |+---------------------+
>
> And then I press <arrow down> again and then my view screen looks like:
>
> +----------------------+ <-vim window
> | int a;               |  
> | int b;               |
> |.int c;...............|  .. = line with cursor
> | int d;               |
> | Foo(100)             |
> |+---------------------+
>
> Thx in advance
>
> Rgds,
> Eric
>
>
> Disclaimer; The information contained in this communication is confidential
> and may be legally privileged. It is intended solely for the use of the individual
> or entity to whom it is addressed and others authorized to recieve it.
> Use of this information, in whatever way, by others is strictly prohibited
> and may be unlawful. GREEFA does not accept legal responsibility
> for this e-mail message due to the insecure nature of internet
> communications.  

Reply | Threaded
Open this post in threaded view
|

RE: Scrolling the buffer iso through the window

Eric Leenman
In reply to this post by Eric Leenman
Yes, that's what I was looking for.
Thx
Eric

-----Oorspronkelijk bericht-----
Van: Dominic Evans [mailto:[hidden email]]
Verzonden: Thursday, September 15, 2005 4:28 PM
Aan: Eric Leenman
CC: [hidden email]
Onderwerp: Re: Scrolling the buffer iso through the window


I think you're asking for the cursor to stay always fixed in the middle
of the window

:set scrolloff=999

read :help scrolloff and see if that is actually what you want

Cheers,
Dominic

On 15/09/05, Eric Leenman <[hidden email]> wrote:
> Hi,
>
> I don't if the terminologie is correct, but is it possible to scroll
> the buffer iso of window.
>
> When I press <arrow down> or <page down> my cursor stays where it was
> in the window, but the buffer moves one up. So that my eyes are always

> at the same row of the screen?
>
> To make it more visual;
> Say for example that my view screen looks like below:
>
> +----------------------+ <-vim window
> |void main()           |
> |{                     |
> |.int a;...............|  .. = line with cursor
> | int b;               |
> | int c;               |
> |+---------------------+
>
> And then I press <arrow down> and then my view screen looks like:
>
> +----------------------+ <-vim window
> |{                     |
> | int a;               |
> |.int b;...............|  .. = line with cursor
> | int c;               |
> | int d;               |
> |+---------------------+
>
> And then I press <arrow down> again and then my view screen looks
> like:
>
> +----------------------+ <-vim window
> | int a;               |
> | int b;               |
> |.int c;...............|  .. = line with cursor
> | int d;               |
> | Foo(100)             |
> |+---------------------+
>
> Thx in advance
>
> Rgds,
> Eric
>
>
> Disclaimer; The information contained in this communication is
> confidential and may be legally privileged. It is intended solely for
> the use of the individual or entity to whom it is addressed and others

> authorized to recieve it. Use of this information, in whatever way, by

> others is strictly prohibited and may be unlawful. GREEFA does not
> accept legal responsibility for this e-mail message due to the
> insecure nature of internet communications.
>


Disclaimer; The information contained in this communication is confidential
and may be legally privileged. It is intended solely for the use of the individual
or entity to whom it is addressed and others authorized to recieve it.
Use of this information, in whatever way, by others is strictly prohibited
and may be unlawful. GREEFA does not accept legal responsibility
for this e-mail message due to the insecure nature of internet
communications.  
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling the buffer iso through the window

Hari Krishna Dara
In reply to this post by Eric Leenman

On Thu, 15 Sep 2005 at 4:20pm, Eric Leenman wrote:

> Hi,
>
> I don't if the terminologie is correct, but is it possible to scroll the
> buffer iso of window.
>
> When I press <arrow down> or <page down> my cursor stays where it was in
> the window, but the buffer moves one up.
> So that my eyes are always at the same row of the screen?
>
> To make it more visual;
> Say for example that my view screen looks like below:
>
> +----------------------+ <-vim window
> |void main()           |
> |{                     |
> |.int a;...............|  .. = line with cursor
> | int b;               |
> | int c;               |
> |+---------------------+
>
> And then I press <arrow down> and then my view screen looks like:
>
> +----------------------+ <-vim window
> |{                     |
> | int a;               |
> |.int b;...............|  .. = line with cursor
> | int c;               |
> | int d;               |
> |+---------------------+
>
> And then I press <arrow down> again and then my view screen looks like:
>
> +----------------------+ <-vim window
> | int a;               |
> | int b;               |
> |.int c;...............|  .. = line with cursor
> | int d;               |
> | Foo(100)             |
> |+---------------------+
>
> Thx in advance
>
> Rgds,
> Eric
>
>
> Disclaimer; The information contained in this communication is confidential
> and may be legally privileged. It is intended solely for the use of the
individual
> or entity to whom it is addressed and others authorized to recieve it.
> Use of this information, in whatever way, by others is strictly prohibited
> and may be unlawful. GREEFA does not accept legal responsibility
> for this e-mail message due to the insecure nature of internet
> communications.
>
>

Set 'scrolloff' to a large number such as 999. This is mentioned at the
below help topic:

:help scrolloff

--
HTH,
Hari


               
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com