Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Efficient switching between windows in emacs [duplicate]

Possible Duplicate:
How can I more easily switch between buffers in Emacs?

While working with emacs I tend to keep many open windows. Unfortunately using M-x other-window is quite annoying. So far I have set up keyboard shortcut in my .emacs file: (global-set-key (quote [backtab]) (quote other-window)). That makes things a bit easier but I am looking for equivalents of commands next-buffer and previus-buffer that can be applied to windows.

like image 353
Karol Avatar asked May 27 '12 15:05

Karol


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 do I switch between frames in Emacs?

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.

How many buffers can be open in Emacs at a time?

At any time, one and only one buffer is selected. It is also called the current buffer.

What is a Emacs buffer?

Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.


1 Answers

Add the following to your .emacs

(windmove-default-keybindings)
(setq windmove-wrap-around t)

Then you'll be able to switch between windows with Shift+{left,up,down,right} arrows. Shift modifier is a parameter to windmove-default-keybindings, so you can choose another one.

You may want to activate a winner-mode. It's a minor mode which remembers your window configurations and you can go to the previous/next configuration using winner-undo or winner-redo.

like image 72
Oleg Pavliv Avatar answered Oct 12 '22 09:10

Oleg Pavliv