Permalink
Browse files

recenter to first/last line on screen

  • Loading branch information...
1 parent 42b3587 commit 3dd23209c9b5eb122db1fce0feaf1687960ddea7 mats cronqvist committed Mar 10, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 .emacs
View
10 .emacs
@@ -47,6 +47,8 @@
utf-translate-cjk-mode nil
visible-bell t)
+(global-set-key (kbd "M-N") 'last-line)
+(global-set-key (kbd "M-P") 'first-line)
(global-set-key (kbd "C-c a") 'align-regexp)
(global-set-key (kbd "C-c b") 'bury-buffer)
(global-set-key (kbd "C-c p") 'point-to-register)
@@ -65,6 +67,14 @@
(global-set-key (kbd "M-z") 'undo) ; if screen eats C-z
(global-set-key (kbd "C-x C-r") 'revert-buffer)
+(defun last-line ()
+ (interactive)
+ (recenter -2))
+
+(defun first-line ()
+ (interactive)
+ (recenter 1))
+
(defun add-paths (ps)
(dolist (f (nreverse ps))
(when (and (stringp f) (file-exists-p f))

0 comments on commit 3dd2320

Please sign in to comment.