Questions tagged [window-splitting]

is for splitting an Emacs window into two. Multiple windows can display different buffers, or different parts of one buffer. Emacs has several default key bindings for splitting windows.

Filter by
Sorted by
Tagged with
13
votes
3answers
2k views

How can I get a sensible split-window policy?

Emacs is constantly making new windows and it's been ruining my day lately. How can I tell emacs to use the following policy when creating windows? Prefer vertical splits Stop doing vertical splits ...
10
votes
2answers
746 views

Collapse split windows

Given split windows like this: |------|-------| |1 |2 | | | | |------|-------| |3 |4 | | | | |------|-------| There are two options to collaps the split ...
9
votes
1answer
915 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 (...
7
votes
1answer
706 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 ...
7
votes
3answers
1k views

Open file from dired in the same window — using the mouse

How do you configure emacs to open a file in the current window -- using the mouse -- when it is selected from a dired buffer? That is, when I open a directory and then select a file with the mouse ...
7
votes
3answers
806 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 ...
6
votes
4answers
682 views

Switch between horizontal and vertical splitting?

From time to time, by mistake, I split my screen vertically C-x 3 (binded to split-window-right), whereas I originally wanted a horizontal splitting C-x 2 (binded to split-window-below). Question: is ...
6
votes
3answers
2k views

Permanent window with list of opened buffers

Is there some mode where emacs fixes a small window with a list of opened buffers? This is what simpler editors have (kate,gedit,etc). Here's an example from Kate: In the left window there is a list ...
6
votes
1answer
1k views

open helm selection in horizontal split

I'm switching from vim and so far everything is going smoothly. One thing I'm sorely missing is ctrlp's functionality for opening the selected file in a horizontal split with C-x or vertical split ...
5
votes
2answers
395 views

Workspace configuration

I'm working with Emacs on several different projects with several different languages. I'm seeking for solution that could help manage project as workspace. Meaning Understand language in use and ...
5
votes
1answer
144 views

emacs home made perspective: source + eshell + compilation

I want such functionality from emacs (gnu 25), I press key in any buffer with source code, and instead of one buffer I got 3 buffers on the screen: source code buffer ------------------ *eshell* | *...
5
votes
1answer
719 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 ...
4
votes
1answer
397 views

Completions buffer messes up window sizes

I am not sure what to search for. I have used emacs for 25+ years, but I am not a guru. I use it as a tool, and I don't want to spend much time changing it. I generally like to have one window, or ...
4
votes
1answer
382 views

Let switch-to-buffer to already open buffer switch to that window, rather than open it in this one

Is there a way to make switch-to-buffer more dwim in this regard? Let's say I have two windows with foo.el and bar.el open. With my point in foo.el, if I switch-to-buffer and open bar.el, I'd like to ...
4
votes
1answer
665 views

Split window buffers

Scenario: I'm working with a horizontal split --------------------- | File 1 | File 2 | | | | | | | ---------------------- and I'm working on File 2. Question ...
4
votes
2answers
104 views

Display all/current CSV heading names

In CSV files (especially ones with a lot of columns and/or a lot of rows) I find that it's hard to tell which column I'm on. Normally I'd like to know either the column heading, or sometimes the ...
4
votes
2answers
595 views

Neotree window permanently resizes other windows

I usually have my emacs frame something like this: | | | | <window 1> | <window 2> | | | | When I open neotree, it then looks like this (...
3
votes
2answers
610 views

How to disable Spacemacs from auto-balancing the split windows?

I am using Spacemacs and after using the splitting windows feature, either by splitting horizontally or vertically, Spacemacs always try to balance the split windows. For example, when pressing C-x 3 ...
3
votes
1answer
534 views

Auto adjust window width based on number of windows?

If i run C-x 3, when emacs starts up it will split window and creates two windows of equal size like this Now i run C-x 3 again it will split current window into two parts resulting in this ...
3
votes
1answer
587 views

Open vertical splits to the right

Using spacemacs with Evil. :vsp opens a new split vertical, but it always does it to the left. How can one configure it to open them to the right?
3
votes
1answer
638 views

Show Helm candidates at left, immediately above minibuffer

If I split a frame vertically, keep point in left split and press M-x, minibuffer will be on bottom and M-x will be in left corner like this. This is very convinient as I can 'see' what I am typing ...
3
votes
1answer
220 views

Splitting window vertically (rather than horizontally) when searching in Dired

My Emacs Dired window is wider than it is tall. After marking some files (say %m *.cpp) in Dired and running M-x dired-do-find-regexp <REGEXP> (A), I find myself in split-window-below (ex split-...
3
votes
1answer
764 views

How to open multiple files without automatically activating the “Buffer List” split?

Running emacs with multiple files automatically opens the "Buffer List" split-window. eg: emacs -Q *.txt Opens a split window, one which contains a list of buffers. How can multiple files be ...
3
votes
1answer
923 views

Is it possible to open links in another buffer (Org Mode)?

i often make links in Org Mode to files, which should open in emacs, but in another buffer than the one, which contains the link. It would be the best, if they open in a buffer next to the one I work ...
3
votes
1answer
194 views

Magit popups no longer behaving as popups (in my setup)

I like to have my emacs set up as one full-screen frame with two side-by-side windows at all time. To do this, I've used this code to force emacs not to split windows arbitrarily: (defun never-split-...
3
votes
1answer
229 views

How to force new `shell` to appear in current window?

Whenever I run M-x shell, a buffer appears almost randomly somewhere - splitting current windows as it sees fit. I cannot work out the logic behind it. The docstring says: (shell &optional ...
3
votes
2answers
221 views

How to force 'Ctrl-X, Ctrl-B' to always split vertically?

Once upon a time, Choose Window (invoked by C-x C-b) used to always split the window vertically. Starting from a certain Emacs version (I can't recall which one), that split is now either vertical or ...
3
votes
1answer
67 views

Have compilation errors / grep match reuse current frame/window without ever splitting it?

I have searched in a number of places (1, 2, 3, 4) even looked at the e-lisp source files and could not figure out how to do, so I ask. Context I have bound next-error to a key. I'm in some source ...
3
votes
1answer
84 views

How to display *help* buffers below one specific window?

I am (really) new in Emacs and ESS, and I am currently trying to customize my environment. The default settings of ESS[R] are convenient for me, since ESS[R] organizes the windows as follows: --------...
3
votes
2answers
83 views

Open org-mode links to info in different window?

I was wondering if anyone knew of a way to open links to info pages (Emacs manual) from org-mode without changing the current buffer to that info page? The reason I would like to do this is because I ...
3
votes
0answers
106 views

How to open all buffers in the same window and never create new one?

I'm using emacs in terminal via emacs-nox and I wish to sort of disable windows functionality at all. I mean I do not want each time to add some buffer to use display-buffer-same-window function, I ...
2
votes
2answers
133 views

How could I get alchemist to always open its test report in a window at the bottom?

alchemist.el has functions for running tests. These functions use display_buffer to show test results. Is there a way to ensure that all Alchemist test results open in a window that is the bottom-most ...
2
votes
2answers
720 views

Algorithm on deciding splitting vertically or horizontally

When I do M-x compile, emacs will split my window to launch compilation and show its logs in a new window. As I understand, it has some algorithm to decide how to split the window. So, when I have ...
2
votes
1answer
80 views

Minimap avoiding change window

Recently I started using minimap-mode, but it has been a bit buggy as sometimes when I split the window and open two different buffers, it won't let me go back to a buffer with code (and minimap). So ...
2
votes
2answers
269 views

Split helm window in different directions

I'd like helm-buffers-list to split my window horizontally, but I'd like for all other Helm functions to split it vertically. Is this possible?
2
votes
1answer
90 views

How can I generate a buffer and render html in it?

I want to make a buffer in a new window (but not pop to it) insert HTML code in it, and render its content with shr-render-*. Yes, an HTML preview window, let me know if you know of a (simple) ...
2
votes
1answer
162 views

Is there a way to configure default window split positions when interacting with commands?

I always enjoyed horizontal splits when interacting with C-h k or a magit commit window, or anything like that. Now I'm seeing vertical splits when I interact with those commands. Is there a way to ...
2
votes
1answer
98 views

can other-buffer in split windows select a visible buffer?

I often swap 2 most latest buffers back and forth with (switch-to-buffer (other-buffer)). This works just fine in most situations. However, when I have 2 split windows, and the other window is ...
2
votes
2answers
357 views

When split-window-sensibly is called, how to make the decision depend on the width height ratio?

I would like to have split-window-sensibly splitting the window horizontally if the width is larger than height, or vertically otherwise. How can I achieve this?
2
votes
1answer
251 views

How can I force emacs to never split frames, in particular for compile-goto-error?

I want emacs to always display new buffers in the current frame, but always taking the whole frame, rather than splitting it. I currently have customized display-buffer-alist to the following '(...
2
votes
1answer
69 views

how can I programatically transition between those 2 window layouts?

I am trying to implement this window transition a/ b/ --------- ------------- | 1 | 2 | | | 1 | 2 | --------- -> | 0 |-------| | 3 | 4 | | | 3 | 4 | --------- ...
2
votes
1answer
48 views

calc splits wrong window.

I have a problem with using calc. When I have two windows open in emacs, split vertically, calc frequently opens in the wrong window. Here's a demonstration of the problem that I ran with emacs -Q. ...
2
votes
2answers
116 views

replace-buffer-in-windows issues in switching from emacs 24.5 to emacs 25.2

I installed Emacs 25.2 on a new system and cannot get the desired behavior with killing buffers when an Emacs frame is split into multiple windows. For example, I have C-x 3 bound to a variation of ...
2
votes
1answer
375 views

How do I start emacs with one horizontal split and one vertical split

Every time I start Emacs, I want two windows, side by side, and one terminal/shell window below them both, as shown here. Please help me with the necessary code to my init file.
2
votes
1answer
200 views

Change which buffers are in which windows?

I have 3 windows opened and I want to change which buffers they display. For example: when programming in C, I want to have the C code on the left, and the right side split into two windows showing ...
2
votes
1answer
223 views

Always pop window into frames

When I use tuareg I like to have the toplevel in a separate frame, but as soon as I evaluate some code in the original frame the toplevel window reopen in that frame and that's not what I wan't. More ...
2
votes
1answer
76 views

How to move windows?

How can I move a window from being a horizontal split down below all other windows to being a vertical split panel on the left? I don't want to move buffer contents - I want to move the actual window.
2
votes
0answers
25 views

Restoring windows with Desktop when running Emacs inside a terminal? [duplicate]

Maybe a silly question: I'm using desktop for saving Emacs' sessions. I've set (setq desktop-restore-frames t) (desktop-save-mode 0) So windows and frames state is supposed to be saved, and I'm ...
2
votes
0answers
147 views

Force new window to open to the left or right

I have two frames open with the following window splits: Frame 1 Frame 2 |---+---+ |------| |a |b | |d | | | | | | |---+---+ | | |c | | | |---+---+ |------| Say that ...
2
votes
0answers
27 views

Keyboard macro with occur

In a keyboard macro, there is an occur command. While recording the macro, I switched to the occur window, did some editing, closed occur buffer reverted back to original buffer to continue editing. ...