Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs, switch to previous window

Tags:

emacs

In Emacs, C-x o takes me to the next window.

What keyboard macro takes me to the previous window in Emacs?

like image 634
Roger C S Wernersson Avatar asked Sep 18 '08 09:09

Roger C S Wernersson


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 go back in Emacs?

To get back into Emacs, type %emacs at the shell prompt. To quit Emacs permanently, type C-x C-c.

How do you change from one buffer to another?

For conveniently switching between a few buffers, use the commands C-x LEFT and C-x RIGHT . C-x LEFT ( previous-buffer ) selects the previous buffer (following the order of most recent selection in the current frame), while C-x RIGHT ( next-buffer ) moves through buffers in the reverse direction.

How do I unsplit windows Emacs?

Use the C-x b command or the Buffers menu. Or if you haven't opened the file, yet, use the C-x C-f command to open the new file in a new buffer. To unsplit the window, use the command C-x 1 or right-click on either title bar.


2 Answers

You might also want to try using windmove which lets you navigate to the window of your choice based on geometry. I have the following in my .emacs file to change windows using C-x arrow-key.

(global-set-key (kbd "C-x <up>") 'windmove-up) (global-set-key (kbd "C-x <down>") 'windmove-down) (global-set-key (kbd "C-x <right>") 'windmove-right) (global-set-key (kbd "C-x <left>") 'windmove-left) 
like image 82
Nate Avatar answered Oct 03 '22 18:10

Nate


That'd be C-- C-x o

In other words, C-x o with an argument of -1. You can specify how many windows to move by inserting a numeric argument between C-u and the command, as in C-u 2 C-x o. (C-- is a shortcut for C-u - 1)

like image 42
JB. Avatar answered Oct 03 '22 19:10

JB.