Emacs: How can I easily create a new window that spans two existing horizontal windows?

I often have an Emacs frame that is split into two windows:

--------------------------------
|                              |
|          Window 1            |
|                              |
|------------------------------|
|                              |
|          Window 2            |
|                              |
--------------------------------

Then I need to have a long vertical window that controls the entire height of the frame, for example:

--------------------------------
|         |                    |
| W'dow 3 |      Window 1      |
|         |                    |
|         |--------------------|
|         |                    |
|         |      Window 2      |
|         |                    |
--------------------------------

However, using C-x 3, you can only split Window 1 or Window 2. The only way to create a long vertical Window 3 is to start again from one window filling the entire frame and split it horizontally (then split one of the windows in half, vertically). This is annoying.

, , , . Googled , . , Emacs, - , ?

+4
2

:

(defun complex-split ()
  (interactive)
  (let (
        (thisBuffer (buffer-name))
        otherBuffer
        )
  (other-window 1)
  (setq otherBuffer (buffer-name))
  (delete-other-windows)
  (split-window-horizontally)
  (other-window 1)
  (split-window-vertically)
  (switch-to-buffer thisBuffer)
  (other-window 1)
  (switch-to-buffer otherBuffer)
  )
)
+1

- C-x r w ( - ).

+1

Source: https://habr.com/ru/post/1543060/


All Articles