Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Emacs, what is the opposite function of other-window (C-x o)? [duplicate]

Tags:

emacs

Possible Duplicate:
Emacs, switch to previous window

other-window advances me to the next window in the current frame, but I also want a way to move back to the previous window.

Emacs has next-buffer and previous-buffer, but no analogous interactive functions for window navigation. Just other-window.

like image 558
someguy Avatar asked Sep 27 '08 05:09

someguy


People also ask

How do I switch between windows in Emacs?

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 ).

How to split windows in Emacs?

You can split a window horizontally or vertically by clicking C-Mouse-2 in the mode line or the scroll bar.


1 Answers

Provide a negative argument with C-u - ("Control+U" then "minus"), or even more simply C-- ("Control minus").

  • Move to previous window: C-- C-x o
  • Move to previous frame: C-- C-x 5 o

From code, (other-window -1) or (other-frame -1) will do the same thing.

Check out the help for the key you want to reverse (e.g. C-h k C-x o to show help for C-x o) and if it says "A negative argument..." you know you can use C--.

like image 146
Matt Curtis Avatar answered Oct 07 '22 18:10

Matt Curtis