13 votes
Accepted

Collapse split windows

Try ace-window. If you bind it like this: (global-set-key "M-p" 'ace-window) You can switch to window 2 by pressing M-p 2. Also, you can delete window 2 by pressing M-p x2: this will bring you ...
user avatar
  • 13.6k
10 votes

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

If you don't like how help-window-select works you can simply use this code: (add-to-list 'display-buffer-alist '("*Help*" display-buffer-same-window)) You can change "*Help*" with a ...
user avatar
  • 1,245
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)
user avatar
  • 1,683
9 votes

Collapse split windows

The function delete-window has an optional argument WINDOW. The function window-in-direction has a mandatory argument of DIRECTION and optional arguments for WINDOW IGNORE SIGN WRAP MIN. To learn ...
user avatar
  • 17.7k
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 ...
user avatar
  • 6,973
8 votes
Accepted

Permanent window with list of opened buffers

M-x speedbar and typing b (buffer display mode). This gives you a narrow dedicated frame with the required information.
user avatar
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-...
user avatar
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 (...
user avatar
  • 20.3k
8 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 ...
user avatar
  • 2,366
7 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 ...
user avatar
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-...
user avatar
  • 19.2k
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: (...
user avatar
  • 4,231
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, ...
user avatar
  • 1,501
6 votes
Accepted

Auto adjust window width based on number of windows?

You can define your own command for this. This allows you to use it when desired, but not change the default behavior of the original commands, keeping them useful individually if desired: (defun ...
user avatar
  • 1,269
6 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, ...
user avatar
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 ...
user avatar
  • 21.1k
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 '...
user avatar
  • 3,276
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 ...
user avatar
  • 20.3k
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.
user avatar
  • 21.1k
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: ...
user avatar
  • 11.4k
4 votes
Accepted

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

If you really want that, just define your own command to do it. You can copy the code for what mouse-2 is already bound to, dired-mouse-find-file-other-window, and just change the occurrence of find-...
user avatar
  • 69.7k
4 votes
Accepted

Show Helm candidates at left, immediately above minibuffer

What you want to achieve might be tricky (if not impossible) to achieve. But it seems that all you want is to keep the helm-sources (the helm window) and the minibuffer in same direction so that you ...
user avatar
  • 7,298
4 votes

Algorithm on deciding splitting vertically or horizontally

The function that splits the window is split-window-sensibly, which can be tweaked by split-width-threshold and split-height-threshold, as Stefan suggested. Alternatively, you can tell Emacs to use a ...
user avatar
  • 1,683
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) ...
user avatar
  • 31.1k
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, "...
user avatar
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)))
user avatar
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: (...
user avatar
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) ...
user avatar
  • 13.6k
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 ...
user avatar
  • 1,173
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)))
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible