unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
@ 2008-10-02 22:11 David Lam
  0 siblings, 0 replies; 8+ messages in thread
From: David Lam @ 2008-10-02 22:11 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

mmm i am definitely an emacs noob

i saw this... http://www.wlindley.com/gnu/vi  and in the first two rows
theres no listed equivalent

theres gotta be some binding or some way to do it i figure though right?

[-- Attachment #2: Type: text/html, Size: 297 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
       [not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
@ 2008-10-03  5:46 ` Livin Stephen
  2008-10-03  6:42   ` zoltan
  2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
  2008-10-10 21:49 ` Joe Casadonte
  2 siblings, 1 reply; 8+ messages in thread
From: Livin Stephen @ 2008-10-03  5:46 UTC (permalink / raw
  To: help-gnu-emacs


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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
  2008-10-03  5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
@ 2008-10-03  6:42   ` zoltan
  2008-10-03 14:20     ` How do you scroll the screen without moving the cursor ? (theC-E " Parker, Matthew
  0 siblings, 1 reply; 8+ messages in thread
From: zoltan @ 2008-10-03  6:42 UTC (permalink / raw
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
  2008-10-03  6:42   ` zoltan
@ 2008-10-03 14:20     ` Parker, Matthew
  0 siblings, 0 replies; 8+ messages in thread
From: Parker, Matthew @ 2008-10-03 14:20 UTC (permalink / raw
  To: zoltan, help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
       [not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
  2008-10-03  5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
@ 2008-10-04 21:11 ` Rodolfo Medina
  2008-10-04 22:58   ` Rupert Swarbrick
  2008-10-10 21:49 ` Joe Casadonte
  2 siblings, 1 reply; 8+ messages in thread
From: Rodolfo Medina @ 2008-10-04 21:11 UTC (permalink / raw
  To: help-gnu-emacs

...how do you scroll the screen without moving point, also in the sense that
you do, say, five times C-v and then five times M-v and find the cursor in the
*same* place as it was before the first C-v...?

I found two packages that do that: pager.el and scroll-in-place.el, but the
side unwished effect is that the `next-screen-context-lines' stops working
properly in TeX and info buffers: you don't have any more the two default lines
of continuity when scrolling by screenfuls, but less, and variable.

Anyone met the same problem?
Rodolfo


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
  2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
@ 2008-10-04 22:58   ` Rupert Swarbrick
  2008-10-05 10:48     ` Rodolfo Medina
  0 siblings, 1 reply; 8+ messages in thread
From: Rupert Swarbrick @ 2008-10-04 22:58 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

Rodolfo Medina <rodolfo.medina@gmail.com> writes:

> ...how do you scroll the screen without moving point, also in the
> sense that you do, say, five times C-v and then five times M-v and
> find the cursor in the *same* place as it was before the first C-v...?
>

I'm afraid I don't actually know the answer to this question (although
I'm sure there will be one). I was also slightly suprised when reading
it that this had never irritated me.

But then I realised what I do: Before starting to scroll, I hit C-Space
to set a mark. Then I wander round the file to my hearts content, not
even necessarily returning to where I started before hitting C-u C-Space
and being back and with point "unmoved".

Maybe this is a useful different way of solving your problem.

Rupert

[-- Attachment #2: Type: application/pgp-signature, Size: 314 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
  2008-10-04 22:58   ` Rupert Swarbrick
@ 2008-10-05 10:48     ` Rodolfo Medina
  0 siblings, 0 replies; 8+ messages in thread
From: Rodolfo Medina @ 2008-10-05 10:48 UTC (permalink / raw
  To: help-gnu-emacs

Rodolfo Medina <rodolfo.medina@gmail.com> writes:

> ...how do you scroll the screen without moving point, also in the sense that
> you do, say, five times C-v and then five times M-v and find the cursor in the
> *same* place as it was before the first C-v...?
>
> I found two packages that do that: pager.el and scroll-in-place.el, but the
> side unwished effect is that the `next-screen-context-lines' stops working
> properly in TeX and info buffers: you don't have any more the two default
> lines of continuity when scrolling by screenfuls, but less, and variable.
>
> Anyone met the same problem?



Rupert Swarbrick <rswarbrick@gmail.com> writes:

> I'm afraid I don't actually know the answer to this question (although
> I'm sure there will be one). I was also slightly suprised when reading
> it that this had never irritated me.
>
> But then I realised what I do: Before starting to scroll, I hit C-Space
> to set a mark. Then I wander round the file to my hearts content, not
> even necessarily returning to where I started before hitting C-u C-Space
> and being back and with point "unmoved".
>
> Maybe this is a useful different way of solving your problem.



Hey, that's great!  Thanks
Rodolfo


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
       [not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
  2008-10-03  5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
  2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
@ 2008-10-10 21:49 ` Joe Casadonte
  2 siblings, 0 replies; 8+ messages in thread
From: Joe Casadonte @ 2008-10-10 21:49 UTC (permalink / raw
  To: help-gnu-emacs

I wrote these years ago; maybe they will help?


(defun scroll-in-place (scroll-up)
  "Scroll window up (or down) without moving point (if possible).

SCROLL-Up is non-nil to scroll up one line, nil to scroll down."
  (interactive)
  (let ((pos (point))
		(col (current-column))
		(up-or-down (if scroll-up 1 -1)))
	(scroll-up up-or-down)
	(if (pos-visible-in-window-p pos)
		(goto-char pos)
	  (if (or (eq last-command 'next-line)
			  (eq last-command 'previous-line))
		  (move-to-column temporary-goal-column)
		(move-to-column col)
		(setq temporary-goal-column col))
	  (setq this-command 'next-line))))

;;;; ------------------------------------------------------------------------
(defun scroll-up-in-place ()
  "Scroll window up without moving point (if possible)."
  (interactive)
  (scroll-in-place t))

;;;; ------------------------------------------------------------------------
(defun scroll-down-in-place ()
  "Scroll window up without moving point (if possible)."
  (interactive)
  (scroll-in-place nil))

(global-set-key (read-kbd-macro "M-<down>") 'scroll-up-in-place)
(global-set-key (read-kbd-macro "M-<up>") 'scroll-down-in-place)


--
Regards,


joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
    Ramblings of a Gay Man => http://www.northbound-train.com/ramblings
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-10-10 21:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
2008-10-03  5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
2008-10-03  6:42   ` zoltan
2008-10-03 14:20     ` How do you scroll the screen without moving the cursor ? (theC-E " Parker, Matthew
2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
2008-10-04 22:58   ` Rupert Swarbrick
2008-10-05 10:48     ` Rodolfo Medina
2008-10-10 21:49 ` Joe Casadonte
2008-10-02 22:11 David Lam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).