I'm new to Emacs. I'm confused about the C-x o command. This command will move the focus to the other
window. If I have many windows, which window will be selected as the target? What's the quickest way to do this?
Thanks
To select a different window, click with Mouse-1 on its mode line. With the keyboard, you can switch windows by typing C-x o ( other-window ).
Moving Between Frames You can use the mouse to select a frame or press C-x 5 o to go to another frame. To see a list of current frames, select Frames from the Buffers menu.
Each Emacs window displays one Emacs buffer at any time. A single buffer may appear in more than one window; if it does, any changes in its text are displayed in all the windows where it appears. But the windows showing the same buffer can show different parts of it, because each window has its own value of point.
"When there are more than two windows, this command moves through all the windows in a cyclic order, generally top to bottom and left to right." - Emacs Manual
http://www.gnu.org/software/libtool/manual/emacs/Other-Window.html
C-x o
is as quick as any other if you just have two windows. When you have more than 2 windows though, it can be a pain getting to the one you want using C-x o
.
The quickest way to move to a particular window to the left/right/top/bottom of the current window is Wind Move. It comes with Emacs 21 and above. You can use Shift + arrow key to move to a window.
http://www.emacswiki.org/emacs/WindMove
First you've got to notice that "window" in Emacs slang means not what you may think it means. What is normally called a window is called "frame" in Emacs. What Emacs calls "window" is a split window inside a frame.
The easiest way to understand what C-x o does is by trying it out yourself.
In a running Emacs instance, first type C-x 2. Now the frame is split vertically into two windows. The cursor ("point") is in the upper of the two windows. Now type C-x 3 and you will have split the upper window horizontally again. All in all you've got three windows now.
Now type C-x o repeatedly to cycle through the different windows. That's it.
Once you've gotten used to the order in which the windows are cycled through, you can do multiple hops at once, thereby skipping some windows, by using the key combination together with a prefix argument. So say, you want to skip one window and thus jump two at once, type C-2 C-x o. This way you can quickly jump to the window you want.
(To return to a single window, type C-x 1.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With