2010-02-27

Moving between windows in Emacs: windmove-default-keybindings

I never used to have such a big monitor, so I made use of switching between buffers a lot. A quick cntl-x-b, etc.

With a big monitor, I find myself using Emacs (in Ubuntu) with the outer window (the thing Ubuntu calls a window anyway) enlarged to full screen. Then within this big window frame, I'll split the frame into smaller "windows" (what Emacs apparently calls "window" I guess) with a cntl-x-2 or cntl-x-3.

You can then switch to the next window with a command like cntl-x-o, and close the window with cntl-x-0, or close all other windows with cntl-x-1. Since I never had more than two windows open in the frame, it never occurred to me to care how to make switching between more windows more efficient.

Now that I do...

Just add (windmove-default-keybindings) to your ~/.emacs and you'll have a nice shift-(arrowkey of your choice) keybindings to move between windows!

More info at http://www.emacswiki.org/emacs/WindMove

Why oh why did I not find this out earlier? :)

No comments: