Emacs: You Have Widescreen? Have Screen Flow Side by Side

Today, most of us use very wide screen. When viewing a long document, you have to page down often. You can make emacs display them side by side, such that left bottom continues to right top. Also, when your cursor moves to the bottom of left pane, it'll appear on the right top. Here's what to do:

Call split-window-horizontallyCtrl+x 3】 (in ErgoEmacs it's 【Alt+$】). Then, call follow-mode.

You can also set the arrow key to scroll instead of moving cursor.

; set up/down arrow to scroll screen by line
(global-set-key (kbd "<up>") (lambda () (interactive) (scroll-down 1)))
(global-set-key (kbd "<down>") (lambda () (interactive) (scroll-up 1)))

You can still move cursor by {【Ctrl+p】,【Ctrl+n】}. (or {【Alt+i】, 【Alt+k】} in ErgoEmacs.)

You can also set to {【Ctrl+】, 【Ctrl+】} instead. Use the syntax (kbd "<C-up>"). (See: Emacs: How to Define Keyboard Shortcuts.)

Thanks to Zhang Tianjin for mentioning this tip.

Popular posts from this blog

Browser User Agent Strings 2012

11 Years of Writing About Emacs

does md5 creates more randomness?