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

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

Re: how to position cursor at top/middle/bottom of the current screen? (


From: David Lam
Subject: Re: how to position cursor at top/middle/bottom of the current screen? ( H / M / L in Vi)
Date: Wed, 8 Oct 2008 16:54:34 -0700

hey cool thanks... this mailing list is helpful wooo  ->

;; from Emacs Mailing list on 10/8/2008 4pm!!!
;; 'H' in vi
(defun move-to-window-first-line ()
  (interactive)
  (move-to-window-line 0))

 ;; 'L' in vi
(defun move-to-window-last-line ()
  (interactive)
  (move-to-window-line -1))

;;    M-r  =  move-to-window   (by itself its 'M' in vi)
(global-set-key "\C-x\M-r" 'move-to-window-first-line)  
(global-set-key "\C-x\M-c" 'move-to-window-last-line) 

On Wed, Oct 8, 2008 at 4:35 PM, Nikolaj Schumacher <me@nschum.de> wrote:
"David Lam" <david.k.lam1@gmail.com> wrote:

> i wanna just move the cursor relative to the current text on the screen...
> is there a built-in function for this?

I only recently found this, even though it is prominently bound to M-r.
The command is `move-to-window-line', which moves to the middle.

For top, bottom:

(defun move-to-top ()
 (interactive)
 (move-to-window-line 0))

(defun move-to-bottom ()
 (interactive)
 (move-to-window-line -1))


regards,
Nikolaj Schumacher


reply via email to

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