As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [window]

In Emacs, a window is one part of a frame, displaying one buffer. For questions about operating system windows, see the tag 'frame.

Filter by
Sorted by
Tagged with
122 votes
13 answers
76k views

How to switch between windows quickly?

How do I switch between windows quickly? I often have multiple windows open and need to switch between them. Right now, I use C-x o to get to the one I want. Is there a more efficient workflow ...
Sibi's user avatar
  • 3,583
45 votes
3 answers
14k views

How to change Emacs windows from vertical split to horizontal split?

Window A ++++++++ Window B Is there a way to switch to Window A : Window B Is there a way to switch view without closing windows?
Nick's user avatar
  • 4,383
44 votes
2 answers
9k views

What's the difference between a buffer, a file, a window, and a frame?

When posing questions on this site, people sometimes talk about "windows" when they mean "frames," and "buffers" or "files" when they mean "windows." So: Q: What is the difference between a buffer, ...
Dan's user avatar
  • 32.3k
30 votes
6 answers
10k views

Switching between window layouts

When I configure a custom layout and then just need to temporary look into one file fullscreen and once I want that layout back - I need manually to reflow it. I would like a plugin/elisp code to ...
lukas.pukenis's user avatar
29 votes
1 answer
7k views

Synchronized scrolling in two windows

Is there a way to reflect the navigation commands in the current window in another visible window. I have two related LaTeX files displayed in two windows and would like to scroll through them ...
Vamsi's user avatar
  • 3,906
26 votes
5 answers
4k views

Hide *compilation* window

It is annoying to see the compilation window appear when it is successful. How to remove that automatically? I want to see it though if it is not successful.
Husain's user avatar
  • 485
25 votes
5 answers
18k views

How to Change size of split screen emacs windows?

If I have Emacs split horizontally and on top I'm editing elisp code and on the bottom I am in the shell. By default, Emacs makes the two windows equal in size, but I'd like the shell buffer smaller. ...
programking's user avatar
  • 6,984
21 votes
2 answers
406 views

Display list of words along bottom of frame?

I'd like to display 3 lists of words on separate lines horizontally along the bottom (although top would work too) of every emacs frame I have open. I've thought of 6 ways to do this, and they all ...
Joseph Garvin's user avatar
20 votes
4 answers
9k views

How to setup default windows at startup?

Every time I open up Emacs I tend to set up 3 windows by doing C-x 3 (split-window-right) and then C-x2 (split-window-below). After that I have to switch to each window to open the files I want to ...
El Diego Efe's user avatar
  • 1,581
20 votes
3 answers
5k views

Is there a way to change color of active window's fringe?

To better distinguish between focused window and rest that are not I would love to change this window's fringe color. Discovering customize with fringe keyword I found only how to change its bg color ...
sandric's user avatar
  • 1,221
18 votes
2 answers
9k views

When should I use with-eval-after-load in my configuration files?

I went over my configuration files and wanted to do some cleanup. My understanding of with-eval-after-load was that its body would be evaluated right after the related package is loaded. While ...
Mathieu Marques's user avatar
17 votes
3 answers
3k views

Quick way to close all but one window, and then revert to previous window setup?

I want to close all my windows but the current one and maximize the frame so I can quickly see everything in the buffer in that one window, and then revert to my previous window setup. How would I go ...
Andrew's user avatar
  • 541
17 votes
2 answers
5k views

Moving the mode line and minibuffer to the top

Is there any way I can move the mode line and the minibuffer from the bottom to the top of the screen? The minibuffer is covered by the previous question How to display the content of minibuffer in ...
Mongus Pong's user avatar
17 votes
2 answers
2k views

How can I prevent a command from using specific windows?

Typically, I have a frame split into four windows, where two at the bottom are dedicated to my *compilation* and *grep* buffers. When browsing compilation errors, next-error will eventually replace my ...
piwi's user avatar
  • 273
16 votes
1 answer
2k views

Switch window split orientation, fastest way

Say you have two buffers open like so: ------------------------------------ | | buffer 1 | buffer 2 | | | ------...
c-o-d's user avatar
  • 910
16 votes
3 answers
3k views

Prefer vertical splits over horizontal ones

There are several questions similar to this one. I have read them all and they don't provide an answer for my scenario. I want emacs to prefer vertical splits (splitting windows into left and right ...
Björn Lindqvist's user avatar
16 votes
1 answer
1k views

How can I block a frame from being split?

Currently I work with ruby and rspec. I really like the idea of having a separate frame in another monitor showing me the compilation buffer. My current setup uses a 'code' frame (in which I do actual ...
Renan Ranelli's user avatar
15 votes
2 answers
4k views

Neotree window not resizable

I get this message when I try to resize the neotree window using my mouse: No resizable window on the left of this one Does anyone know how I can make the neotree window re-sizable?
Rotareti's user avatar
  • 426
14 votes
2 answers
1k views

"Pop" a window into a frame

Often, I my windows get automatically split until I arbitrarily decide that the current frame does not have enough real-estate for them all. When this occurs, I manually delete a window, create a ...
PythonNut's user avatar
  • 10.2k
13 votes
2 answers
3k views

How do I force a specific buffer to open in a new window?

When committing changes in Magit, it is useful to have the diff view open while adding details about the commit. In Magit, we see the diff in the *magit ..* buffer. When you hit cc while the cursor ...
Kaushal Modi's user avatar
13 votes
1 answer
5k views

Open file in new window after searching it with helm

As written in A Package in a league of its own: Helm there's a way to search for a file using Helm decide after searching whether open it in same or other window My question is: How?
Empty_Mind's user avatar
  • 1,341
13 votes
1 answer
1k views

How to control in which window a buffer is displayed?

Q: how can I control which window org-deadline uses to display the calendar? org-deadline temporarily pops up the calendar buffer in a window when setting a deadline, and then closes it again after ...
Dan's user avatar
  • 32.3k
13 votes
1 answer
2k views

Open helm search result in a new window?

Commands like helm-projectile-grep, helm-swoop, projectile-find-file are extremely useful for jumping around code. However, so far I've not found how I can open a search result in a new window (...
space_voyager's user avatar
13 votes
2 answers
921 views

Change highlight color when window isn't in focus?

I'm using hl-mode as a minor mode for deft. How do I make the highlighted line change color (e.g. to gray) when the deft window isn't the current window, and then back to the default highlight color ...
shankar2k's user avatar
  • 163
12 votes
1 answer
3k views

How to count all of the windows in a frame?

Just as the question stated, I would like a function that would count of the windows that are currently being shown in that frame. So this: +--------------+-------------+ | | ...
programking's user avatar
  • 6,984
12 votes
3 answers
666 views

Defining the window pointed by "other-window"

In emacs, more often than i like, I end up with 4 windows or more. I'll use that example: +--------|-----------+ | | | | 1 | 2 | | | | +--------+-----...
Lompik's user avatar
  • 1,214
11 votes
2 answers
12k views

Can I split emacs the window 4 ways (vertically and horizontally) in a 4 grid layout with different files in each?

I just started using emacs and since I have been using Sublime Text for a while, I am used to the four-grid-layout with 4 windows stacked horizontally and vertically. I have been able to split the ...
twodee's user avatar
  • 163
11 votes
2 answers
6k views

Open new window and switch to it

Assume I'm opening a new window with for example C-x 2 or C-x 3 then the buffer opens and I need to switch to it by hand with C-x o. Is there a build in solution to do this with one command? Or even ...
daeda's user avatar
  • 439
11 votes
2 answers
3k views

Single mode line for all windows

Is it possible to have only one mode line (sometimes referred as "statusbar") for all windows? I'd like to make this single mode line show information about the currently selected buffer.
rgtk's user avatar
  • 414
11 votes
0 answers
851 views

How to immediately resize the minibuffer window?

Suppose that I have this function, that inserts some stuff into the minibuffer: (defun foobar () (interactive) (minibuffer-with-setup-hook (lambda () (let ((resize-mini-windows t)) ...
abo-abo's user avatar
  • 13.9k
10 votes
4 answers
1k views

One window per project

I am working on several projects right now. I want a single instance of Emacs to handle them all. What I want is a tmux-like behavior wherein every 'window' (in the Emacs sense) corresponds to a ...
sudeepdino008's user avatar
10 votes
2 answers
3k views

org-babel result to a separate buffer

I use org-babel to generate some reports which can't be automatically processed, and since org is a good outline format, I print the results in org to represent them as trees. I've noticed that ...
Roman Grazhdan's user avatar
10 votes
2 answers
4k views

How to get org-agenda to prefer split-window-right

After upgrading to Emacs 24.4.1, when I call org-agenda with no splits it will show on the bottom half of the frame. Previously, it would show on the right half. How do I configure this behaviour?
Nathaniel Flath's user avatar
10 votes
2 answers
2k views

Automatically switch focus to new window

Is there a way to automatically switch focus to any new windows? For example, if I C-h f some-function, that creates a new window. But the focus remains where I was, so when I'm done reading and hit ...
Alex's user avatar
  • 1,018
9 votes
4 answers
1k views

Async shell process buffer always clobbers window arrangement

I frequently launch external programs from emacs using M-!, such as Firefox or Evince, etc. Whenever I do, a buffer pops up full of results for the process, which clobbers whatever else I've got going ...
Steven Arntson's user avatar
9 votes
2 answers
5k views

Splitting windows on startup

How do I split my windows on startup like so: _____________ | A | B | |_____|_____| | C | |___________|
Asad-ullah Khan's user avatar
9 votes
1 answer
8k views

How can I prevent GNU Emacs from splitting windows on startup?

Whenever I try to open an existing file with GNU Emacs, the window always split horizontally so as to show two buffers: one buffer containing the file and the GNU Emacs buffer. How can I set up Emacs ...
Charo's user avatar
  • 855
9 votes
1 answer
2k views

`switch-to-buffer` vs. `pop-to-buffer-same-window`

What is the difference between pop-to-buffer-same-window and switch-to-buffer? switch-to-buffer-other-window is basically an alias for pop-to-buffer, so I'm surprised that pop-to-buffer-same-window ...
Tianxiang Xiong's user avatar
9 votes
4 answers
2k views

How to autoscroll a window to always show the end of a growing buffer?

Context: I have a window that shows the output of a shell command. As new lines are added, I'd like the window to always show the most recent lines. Example: (let ((temp-window (or (get-buffer-...
tmalsburg's user avatar
  • 2,540
9 votes
2 answers
2k views

How can I prevent gdb *input/output* buffer from aggressively popping up in frame?

When using gdb with M-x gdb, the *input/output* buffer always pops up aggressively in any frame which has focus and isn't already displaying it. I would like the *input/output* buffer to stay quietly ...
ajp's user avatar
  • 393
9 votes
2 answers
508 views

Split Window at outermost border

I'm looking for a way to add a new full-height window split to an existing (splitted) window configuration. Because I don't know how to explain it properly I'll just post some ASCII graphics showing ...
elemakil's user avatar
  • 2,507
8 votes
3 answers
986 views

How to cycle between two windows when I have more than two open?

Scenario: I have several (more than 2) windows open. I actively work with two of them. How do I best jump from one window to another, and back, with one command? I use ace-window; it's great but I ...
9000's user avatar
  • 497
8 votes
2 answers
2k views

save-excursion doesn't restore the currently visible buffer?

From the save-excursion docstring: Save point, mark, and current buffer; execute BODY; restore those things. My understanding was that the restored buffer would again be visible following the ...
ebpa's user avatar
  • 7,239
8 votes
1 answer
2k views

How can I tell Emacs to always open help buffers in the current window?

When looking up documentation with describe-function, Emacs display the docstring in a temporary help buffer. I want this buffer to replace current window. So far, I've customized help-window-select ...
Mathieu Marques's user avatar
8 votes
1 answer
755 views

How to make occur mode select the window of buffer `*Occur*`?

Is it possible to make the occur mode grab the cursor (point)?, right now when I do M-x occur and search anything in a buffer, it will open the new buffer with the findings but the cursor stays in the ...
Fabman's user avatar
  • 568
8 votes
2 answers
5k views

How can I adjust the fixed-width of a Neotree buffer?

Using emacs 24, when I try to use the Neotree package I am having issues with modifying the fixed-width of the window. I believe I have found the responsible chunk of lisp, but changing the value ...
Adam's user avatar
  • 81
8 votes
2 answers
2k views

How to display a help buffer/window full frame size (not full screen)

I sometimes want to display information in Help buffer style, so I have been using code like this: (with-help-window (help-buffer) (princ "Type q to exit this help buffer.\n\n") (princ result)) ...
Kevin's user avatar
  • 1,298
8 votes
1 answer
2k views

desktop-save-mode fails to save window layout

I use Emacs 24.5.1 on OS X in terminal mode. I intend to use desktop-save-mode to save and restore window layout (i.e. positions of buffer windows) upon exiting and starting Emacs. From this answer ...
skyork's user avatar
  • 211
8 votes
1 answer
191 views

How to determine the line number of the first visible line of a window?

How to determine the line number of the first visible line of a window?
Name's user avatar
  • 7,644
8 votes
2 answers
1k views

Hook that indicates when the cursor has been moved by scrolling

Inspired by this question: Let Emacs move the cursor off-screen, I am considering writing a minor mode that will keep the cursor in a fixed position that is not affected by scrolling operations. I ...
nispio's user avatar
  • 8,143

1
2 3 4 5
9