home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.emacs.help
- Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!bnrgate!bmerh85!bmerh85!hamish
- From: Hamish.Macdonald@x400gate.bnr.ca (Hamish Macdonald)
- Subject: Re: Equivalents to vi's H, M, L Commands?
- In-Reply-To: mac@crchh570.BNR.CA's message of Wed, 09 Sep 1992 18:35:31 GMT
- Message-ID: <1992Sep09.192805.12394@bmerh85.bnr.ca>
- Lines: 29
- Sender: news@bmerh85.bnr.ca (Usenet News)
- Organization: Bell Northern Research
- References: <1992Sep09.183531.5615@bnr.ca>
- Date: Wed, 09 Sep 92 19:28:05 GMT
-
- >>>>> On Wed, 09 Sep 1992 18:35:31 GMT,
- >>>>> In message <1992Sep09.183531.5615@bnr.ca>,
- >>>>> mac@crchh570.BNR.CA (Michael Campbell) wrote:
-
- Michael> Does anyone know of emacs functions that perform a similar
- Michael> function to the vi commands H, M, and L (Home, Middle, and
- Michael> Last)? These functions move the cursor to the top of the
- Michael> screen (Home), the middle line of the screen (Middle), and
- Michael> the last line of the screen (Last). They do not effect vi's
- Michael> position in the file - they simply allow you to move the
- Michael> cursor around the currently displayed screen. Please post any
- Michael> replies to this newsgroup. Thanks!
-
- (defun top-of-window ()
- "Go to top line of window"
- (interactive)
- (goto-char (window-start)))
-
- (defun middle-of-window()
- "Go to middle line of window"
- (interactive)
- (goto-char (/ (- (window-end) (window-start)) 2))
- (beginning-of-line))
-
- (defun bottom-of-window()
- "Go to last line of window"
- (interactive)
- (goto-char (window-end))
- (beginning-of-line))
-