From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "David Lam" Newsgroups: gmane.emacs.help 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 Message-ID: <4f6ab4670810081654r5e46e167jd5bed6266d575df1@mail.gmail.com> References: <4f6ab4670810081609l539df820m61c2489a63c73b9c@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_92282_811556.1223510074664" X-Trace: ger.gmane.org 1223510106 25804 80.91.229.12 (8 Oct 2008 23:55:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Oct 2008 23:55:06 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Nikolaj Schumacher" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 09 01:56:04 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Knist-0001Ky-Ln for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Oct 2008 01:56:04 +0200 Original-Received: from localhost ([127.0.0.1]:55396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kniro-00050x-Pn for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Oct 2008 19:54:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnirV-0004zi-P9 for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 19:54:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnirV-0004zI-FT for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 19:54:37 -0400 Original-Received: from [199.232.76.173] (port=58495 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnirV-0004z5-5E for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 19:54:37 -0400 Original-Received: from fg-out-1718.google.com ([72.14.220.153]:46105) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KnirV-0000RH-1A for help-gnu-emacs@gnu.org; Wed, 08 Oct 2008 19:54:37 -0400 Original-Received: by fg-out-1718.google.com with SMTP id l26so3168326fgb.30 for ; Wed, 08 Oct 2008 16:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=BR9/Zu4eFVurFHAWpr9xA8Ai9WvFPGbuZqUJgrr2YoE=; b=BA6y43CzskHgTTAknAgaQJX9MnkkweNh5dt8H3+Kh6x5BA0X5lYTPzGQp6gr4dFZIf 1y14YZn3uAthINoIGnysUz44/z6mjoP+yn2rL8A3DdIFh7MzQ81s1IptbAb7pP2grq2A TiBbdlF6t1kKyB78x8Y4HMA13BFRXaQB4U9L4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=DlPmuSb/nP/dWxhenk3ToHNO6mJOY5EeMSupM2cVAGeKar0HJtJ8XDHZp4KtSPVQCI c45bpFnWG35VrefY1n1wv+2joFkHsm34aguzQnh369G8PfaRwVWPn2u9ABOVBtOOhC7k C1NCuYqJXgcjcNmqcSoUfKWwS9rGEgT6mo6Oo= Original-Received: by 10.187.171.8 with SMTP id y8mr1689338fao.57.1223510074663; Wed, 08 Oct 2008 16:54:34 -0700 (PDT) Original-Received: by 10.187.252.3 with HTTP; Wed, 8 Oct 2008 16:54:34 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58588 Archived-At: ------=_Part_92282_811556.1223510074664 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 wrote: > "David Lam" 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 > ------=_Part_92282_811556.1223510074664 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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

------=_Part_92282_811556.1223510074664--