all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "David Lam" <david.k.lam1@gmail.com>
To: "Chris McMahan" <first_initiallastname@one.dot.net>
Cc: 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)
Date: Fri, 3 Oct 2008 17:57:57 -0700	[thread overview]
Message-ID: <4f6ab4670810031757w683ee1ffne5ed4879484ae98a@mail.gmail.com> (raw)
In-Reply-To: <7sk5cph283.fsf@one.dot.net>

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

aww cool thanks... i just tried the stuffs

this is what i ended up with ->

;; ^E in Vi
(defun ctrl-e-in-vi (n)
 (interactive "p")
 (scroll-down n))

;; ^Y in Vi
(defun ctrl-y-in-vi (n)
 (interactive "p")
 (scroll-up n))

(global-set-key "\M-n" 'ctrl-y-in-vi)
(global-set-key "\M-p" 'ctrl-e-in-vi)






On Fri, Oct 3, 2008 at 1:07 PM, Chris McMahan <
first_initiallastname@one.dot.net> wrote:

> Paul R <paul.r.ml@gmail.com> writes:
>
> > Chris> If that's not what you have in mind, I've been using these for
> > Chris> some time. They keep the cursor in place and move the text
> > Chris> underneath it.
> >
> > Chris> (defun scroll-down-in-place (n) (interactive "p")
> > Chris> (previous-line n) (scroll-down n))
> >
> > Chris> (defun scroll-up-in-place (n) (interactive "p") (next-line n)
> > Chris> (scroll-up n))
> >
> > To avoid weird behaviour when seeing ends of your buffer, use the code
> > below.
> >
> > (global-set-key [down] (lambda ()
> >                        (interactive)
> >                        (next-line 1)
> >                        (unless (eq (window-end) (point-max))
> >                          (scroll-up 1))))
> > (global-set-key [up] (lambda ()
> >                      (interactive)
> >                      (previous-line 1)
> >                      (unless (eq (window-start) (point-min))
> >                        (scroll-down 1))))
>
> Excellent! Thank you!
>
> BTW, where can I get info on the key syntax you're using? [down] and
> [up]...
>
> - Chris
>
> --
>     (.   .)
>  =ooO=(_)=Ooo=====================================
>  Chris McMahan | first_initiallastname@one.dot.net
>  =================================================
>

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

  reply	other threads:[~2008-10-04  0:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.142.1223043676.25473.help-gnu-emacs@gnu.org>
2008-10-03 15:31 ` How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi) Chris McMahan
2008-10-03 16:09   ` Paul R
2008-10-03 19:57     ` How do you create a "cscope buffer window" in ecb ? - very useful Sanjeev Kumar.S
     [not found]   ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
2008-10-03 20:07     ` How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi) Chris McMahan
2008-10-04  0:57       ` David Lam [this message]
2008-10-04  9:03       ` Paul R
2008-10-04 21:24     ` Livin Stephen
2008-10-03  6:42 How do you scroll the screen without moving the cursor ? (the C-E " zoltan
2008-10-03 14:20 ` How do you scroll the screen without moving the cursor ? (theC-E " Parker, Matthew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f6ab4670810031757w683ee1ffne5ed4879484ae98a@mail.gmail.com \
    --to=david.k.lam1@gmail.com \
    --cc=first_initiallastname@one.dot.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.