drewp

Categories: weblog | emacs


T 2008-05-27T22:22:06 emacs scroll keys:

I like making the keypad plus/minus keys scroll my emacs window without moving the cursor. For ~/.emacs:

(defun scroll-down-keep-cursor ()
;; Scroll the text one line down while keeping the cursor
(interactive)
(scroll-down 1))

(defun scroll-up-keep-cursor ()
;; Scroll the text one line up while keeping the cursor
(interactive)
(scroll-up 1))

(global-set-key [kp-subtract] 'scroll-down-keep-cursor)
(global-set-key [kp-add] 'scroll-up-keep-cursor)

2006-05-22T09:41:51 dmacro for emacs:

install http://www.pitecan.com/DynamicMacro/dmacro.el

add this to .emacs:

  (autoload 'dmacro-exec "dmacro" nil t) 
  (defconst *dmacro-key* "\C-t" "repeat") 
  (global-set-key *dmacro-key* 'dmacro-exec)

Now you perform some sequence of commands two times, and press C-t to keep repeating it.

Also, check out follow-mode, which ties multiple windows in the same frame (which you probably make with C-x 3) so that the second window always shows the lines that come after the visible lines in the first window, etc. I might have named it newspaper-columns-mode. Now I can easily see an 300-line program on one screen.

And if you like columns, don't miss the experimental support in firefox, for example here or here (messier).


[Main]

Unless otherwise noted, all content licensed by Drew Perttula
under a Creative Commons License.