10
votes
Accepted
How to disable Spacemacs from auto-balancing the split windows?
Spacemacs sets window-combination-resize to t, which causes Emacs to split windows evenly. You need to add this to user-config:
(setq window-combination-resize nil)
9
votes
Accepted
C-x 3 open a new buffer to the left of the current buffer
C-x 3 is bound to the function split-window-right, that splits the current window horizontally, selecting the left window. We can define a function split-window-left that calls it then change the ...
9
votes
Split Emacs Screen Three Ways
you can:
add this to your .emacs file
(split-window-right)
(other-window 1)
(split-window-below)
(other-window -1)
set it up manually any time: C-x 3 C-x o C-x 2 C-- C-x o
consider using one of ...
8
votes
desktop-save-mode fails to save window layout
In order for desktop-read (the function used to restore your desktop from a file) to restore the frameset that was saved in the desktop, it must call desktop-restoring-frameset-p (i.e., "should I ...
8
votes
Open helm search result in a new window?
C-z will bring up a new buffer with actions available to helm, and I see the following:
[f1] Open file
[f2] Open file other window
[f3] Save results in buffer
[f4] Edit search results
So you want C-...
8
votes
Accepted
Prefer vertical splits over horizontal ones
In my experience this is a harder problem that one might think, because one's intuitive idea of what is sensible is not always easy to put in precise terms. I'll just describe what I've ended up with, ...
8
votes
Accepted
Switching between horizontal and vertical splitting?
I use the following for this:
(defun toggle-window-split ()
(interactive)
(if (= (count-windows) 2)
(let* ((this-win-buffer (window-buffer))
(next-win-buffer (window-buffer (...
7
votes
Switching between horizontal and vertical splitting?
You can roll your own as @Tyler suggested, but there are some packages that support this. Check out the transpose-frame package on MELPA: https://melpa.org/#/transpose-frame
This handles the simple 2-...
6
votes
Workspace configuration
I use a combination of two different tools for project management:projectile, for switching between projects, and perspective, for managing frames within a given project. (The two also integrate well, ...
6
votes
How can I get a sensible split-window policy?
A little late, but because I also searched for this and could not find a ready solution:
You could define your own split-window-sensibly function.
To do so, put the following in your init.el:
(setq ...
6
votes
Accepted
How to open new window below _all_ other windows?
Yes, it is.
(split-window (frame-root-window) (truncate (* (window-total-height (frame-root-window)) 0.75)) 'below)
The crucial part is (frame-root-window) which returns a window spanning the whole ...
5
votes
Accepted
Completions buffer messes up window sizes
This appears to be a change in the way completion windows are created/removed. You can avoid it by setting window-combination-resize to t:
(setq window-combination-resize t)
The current default ...
5
votes
Is there a better way to override opening window in compilation-goto-locus?
You could use display-buffer-alist and dispatch on the executed
command, like this.
(defvar display-buffer-same-window-commands
'(occur-mode-goto-occurrence compile-goto-error))
(add-to-list '...
5
votes
Open vertical splits to the right
(setq evil-vsplit-window-right t)
Now, I can't tell you where to put this because I don't use Spacemacs, but I'm reasonably sure you already know.
5
votes
Accepted
How to open multiple files without automatically activating the "Buffer List" split?
The user option which determines whether a Buffer Menu is displayed is inhibit-startup-buffer-menu:
inhibit-startup-buffer-menu is a variable defined in ‘startup.el’.
Its value is nil
Documentation:
...
4
votes
Accepted
Open several files in a specifc layout with a shortcut
It will be necessary to decide ahead of time what windows/buffers will be A, B and C. The alist argument for the left window-width can be adjusted to taste -- it is presently hard-coded to 70. This ...
4
votes
Accepted
emacs home made perspective: source + eshell + compilation
Here is a bare-bones minimum viable function, which I hope does what you want.
(defun wjh3pane-create-3pane-layout ()
"Create 3-pane layout of windows in the current frame.
Layout is as follows:
...
4
votes
Accepted
can other-buffer in split windows select a visible buffer?
other-buffer takes an optional third argument that says it's
okay to use buffers visible in other windows. The relevant bit of
the docstring:
(other-buffer &optional BUFFER VISIBLE-OK FRAME)
...
Dan♦
- 33.3k
4
votes
Minimap avoiding change window
It's been happening to me ever since I installed Emacs + Spacemacs.
After a year, I decided to fiddle with M-x customize group minimap, and just found out that the 3rd option from top to bottom, "...
4
votes
How to force new `shell` to appear in current window?
Here's what I have for this. It opens a shell in the current window.
(add-to-list 'display-buffer-alist
'("^\\*shell\\*$" . (display-buffer-same-window)))
4
votes
Switching between horizontal and vertical splitting?
I've not tried the transpose-frame package so I don't know how it compares, but I use the package https://melpa.org/#/rotate . Combined that with https://melpa.org/#/smartrep using the config:
(...
4
votes
Accepted
Copy-paste text among Split Window Buffers
Here is another opinionated implementation, it assumes 2 windows layout and isn't as sophisticated as append-to-buffer, the point is Emacs is very easy to extend.
(defun my-copy-to-next-window (b e)
...
4
votes
Accepted
Open org-mode links to info in different window?
I happened on this old thread as I was trying to figure out the same headache myself, and I thought it worthwhile to share my solution. You can modify the info link handling in a few ways. One method ...
4
votes
Two windows split horizontally-> can't split vertically
Emacs is doing what you are asking it to do, unfortunately.
https://www.emacswiki.org/emacs/TransposeFrame is a package which allows you to flip the contents of your frame along the horizontal or ...
4
votes
Accepted
How can I split a window so that the cursor ends up in the right / lower window?
Try this:
(defun olav-split-window-left ()
(interactive)
(select-window (split-window-right)))
4
votes
Accepted
What controls whether `M-x compile` splits a frame into two windows?
compile displays the output buffer using display-buffer (as do most other commands, fwiw). You can see this in compile.el, which is included with Emacs. There is always a link from the help for a ...
3
votes
How to prevent some new buffers from splitting the window?
There is a global option to prevent splits from being opened:
(setq pop-up-windows nil)
When writing scripts you can locally assign this which won't apply outside the scope of the function, eg:
(...
3
votes
Accepted
Is it possible to open links in another buffer (Org Mode)?
Please have a look at the variable org-link-frame-setup. In its documentation string you'll find the searched for information.
You might do this with the keyboard sequence C-h v and then typing above ...
3
votes
Workspace configuration
Consider using Emacs bookmarks, with Bookmark+, including, in particular:
Desktop bookmarks.
Bookmark-file and Bookmark-list bookmarks.
Dired and Dired-tree bookmarks. Search for "dired" in the ...
3
votes
Accepted
Is there a way to configure default window split positions when interacting with commands?
The variables split-height-threshold and split-width-threshold can be customized to control how the function split-window-sensibly behaves:
https://www.gnu.org/software/emacs/manual/html_node/elisp/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
window-splitting × 163window × 55
buffers × 20
frames × 13
org-mode × 6
helm × 6
spacemacs × 5
init-file × 5
dired × 4
ess × 4
org-agenda × 3
mode-line × 3
start-up × 3
occur × 3
display-buffer-alist × 3
selected-window × 3
dedicated-windows × 3
evil × 2
shell × 2
eshell × 2
minibuffer × 2
projectile × 2
find-file × 2
scrolling × 2
compilation × 2