help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you scroll the screen without moving the cursor ? (theC-E and


From: Chris McMahan
Subject: Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
Date: Fri, 03 Oct 2008 11:31:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt)

If that's not what you have in mind, I've been using these for some
time. They keep the cursor in place and move the text underneath it.

(defun scroll-down-in-place (n)
  (interactive "p")
  (previous-line n)
  (scroll-down n))

(defun scroll-up-in-place (n)
  (interactive "p")
  (next-line n)
  (scroll-up n))

(global-set-key "\M-n" 'scroll-up-in-place)
(global-set-key "\M-p" 'scroll-down-in-place)

- Chris

"Parker, Matthew" <MParker@seic.com> writes:

> This might not be the most elegant... but it works... and I think it is what 
> you have in mind...
>
> Add these to .emacs, and try Control-Alt-n or p
>
>   ;; Navigation Functions
>       (defun scroll-up-by-one-line()
>         "scroll ahead one line at a time"
>         (interactive)
>         (scroll-up 1))
>
>       
>       (defun scroll-down-by-one-line()
>         "scroll ahead one line at a time"
>         (interactive)
>         (scroll-down 1))
>
>   ;; key bindings
>
>       (global-set-key "\C-\M-n" 'scroll-up-by-one-line)
>       (global-set-key "\C-\M-p" 'scroll-down-by-one-line)
>
>
> Matthew Parker
>
> SEI  | 1 Freedom Valley Drive | Oaks, PA 19456 | p: 610-676-1279 | f: 
> 484-676-1279 | www.seic.com
>
> -----Original Message-----
> From: help-gnu-emacs-bounces+mparker=seic.com@gnu.org 
> [mailto:help-gnu-emacs-bounces+mparker=seic.com@gnu.org] On Behalf Of zoltan
> Sent: Friday, October 03, 2008 2:43 AM
> To: help-gnu-emacs@gnu.org
> Subject: Re: How do you scroll the screen without moving the cursor ? (theC-E 
> and C-Y keys in vi)
>
> On Oct 3, 7:46 am, Livin Stephen <livin.step...@gmail.com> wrote:
>> On Oct 3, 3:11 am, "David Lam" <david.k.l...@gmail.com> wrote:
>>
>> >...
>> > i saw this...http://www.wlindley.com/gnu/vi and in the first two rows
>> > theres no listed equivalent
>> > ...
>>
>> David,
>>  C-v is how you scroll one-page-at-a-time, so with numerical arguments
>> ( "C-u 1" [ or "Cu -1" ] ),
>> here is how I would do it:
>>
>> C-u 1 C-v for "up", and
>> C-u -1 C-v for "down" .
>>
>> I don't know *any* lisp,
>>  so if I found myself wanting to do this a lot,
>>  I would probably create a macro and setup a key-binding.
>
> You can also use M-v to scroll up.
> And C-M-v to scroll down the next buffer
>
>

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]