What the .emacs.d!?

There are lots of neat ways of moving around quickly in a buffer.


;; Move more quickly
(global-set-key (kbd "C-S-n")
                (lambda ()
                  (interactive)
                  (ignore-errors (next-line 5))))

(global-set-key (kbd "C-S-p")
                (lambda ()
                  (interactive)
                  (ignore-errors (previous-line 5))))

(global-set-key (kbd "C-S-f")
                (lambda ()
                  (interactive)
                  (ignore-errors (forward-char 5))))

(global-set-key (kbd "C-S-b")
                (lambda ()
                  (interactive)
                  (ignore-errors (backward-char 5))))

For instance, check out Emacs Rocks e10: Jumping Around.

But sometimes I just want to browse a little. Or move a few lines down. These keybindings let me do that more quickly than C-n C-n C-n C-n C-n C-n ...

In fact, with these I can navigate to any line within a distance of 11 in 3 keystrokes or less. Or close enough to count. Two of them require 4 keystrokes. Can you figure out which ones?

blog comments powered by Disqus