Skip to main content

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 split-height-threshold 120
      split-width-threshold 160)

(defun my-split-window-sensibly (&optional window)
    "replacement `split-window-sensibly' function which prefers vertical splits"
    (interactive)
    (let ((window (or window (selected-window))))
        (or (and (window-splittable-p window t)
                 (with-selected-window window
                     (split-window-right)))
            (and (window-splittable-p window)
                 (with-selected-window window
                     (split-window-below))))))
    
(setq split-window-preferred-function #'my-split-window-sensibly)
(setq split-height-threshold 120
      split-width-threshold 160)

(defun my-split-window-sensibly (&optional window)
    "replacement `split-window-sensibly' function which prefers vertical splits"
    (interactive)
    (let ((window (or window (selected-window))))
        (or (and (window-splittable-p window t)
                 (with-selected-window window
                     (split-window-right)))
            (and (window-splittable-p window)
                 (with-selected-window window
                     (split-window-below))))))

(setq split-window-preferred-function #'my-split-window-sensibly)

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

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 split-height-threshold 120
      split-width-threshold 160)

(defun my-split-window-sensibly (&optional window)
    "replacement `split-window-sensibly' function which prefers vertical splits"
    (interactive)
    (let ((window (or window (selected-window))))
        (or (and (window-splittable-p window t)
                 (with-selected-window window
                     (split-window-right)))
            (and (window-splittable-p window)
                 (with-selected-window window
                     (split-window-below))))))
    
(setq split-window-preferred-function #'my-split-window-sensibly)

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

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 split-height-threshold 120
      split-width-threshold 160)

(defun my-split-window-sensibly (&optional window)
    "replacement `split-window-sensibly' function which prefers vertical splits"
    (interactive)
    (let ((window (or window (selected-window))))
        (or (and (window-splittable-p window t)
                 (with-selected-window window
                     (split-window-right)))
            (and (window-splittable-p window)
                 (with-selected-window window
                     (split-window-below))))))

(setq split-window-preferred-function #'my-split-window-sensibly)

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

code improved
Source Link
jue
  • 4.7k
  • 10
  • 21

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:

(progn
    (setq split-height-threshold 120
          split-width-threshold 160)

    (defun my-split-window-sensibly (&optional window)
      "replacement `split-window-sensibly' "replacementfunction which splitsprefers vertical first"splits"
        (interactive)
        (let ((window (ifor window (selected-window))))
        (or (and (window-splittable-p window t)
                 (with-selected-window window
                          (selectedsplit-window)-right)))
            (ifand (window-splittable-p window t)
                    (splitwith-windowselected-right)
                (if (window-splittable-p window)
                        (split-window-below))))))
    
    (setq split-window-preferred-function #'my-split-window-sensibly))

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

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:

(progn
    (setq split-height-threshold 120
          split-width-threshold 160)

    (defun my-split-window-sensibly (&optional window)
        "replacement which splits vertical first"
        (interactive)
        (let ((window (if window
                              window
                          (selected-window))))
            (if (window-splittable-p window t)
                    (split-window-right)
                (if (window-splittable-p window)
                        (split-window-below)))))
    
    (setq split-window-preferred-function #'my-split-window-sensibly))

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

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 split-height-threshold 120
      split-width-threshold 160)

(defun my-split-window-sensibly (&optional window)
    "replacement `split-window-sensibly' function which prefers vertical splits"
    (interactive)
    (let ((window (or window (selected-window))))
        (or (and (window-splittable-p window t)
                 (with-selected-window window
                     (split-window-right)))
            (and (window-splittable-p window)
                 (with-selected-window window
                     (split-window-below))))))
    
(setq split-window-preferred-function #'my-split-window-sensibly)

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

code fixed
Source Link
jue
  • 4.7k
  • 10
  • 21

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:

(progn
    (setq split-height-threshold 120
          split-width-threshold 160)

    (defun my-split-window-sensibly (&optional window)
        "replacement which splits vertical first"
        (interactive)
        (let ((window (if (boundp 'window)window
                              window
                          (selected-window))))
            (if (window-splittable-p window t)
                    (split-window-right)
                (if (window-splittable-p window)
                        (split-window-below)))))
    
    (setq split-window-preferred-function #'my-split-window-sensibly))

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

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:

(progn
    (setq split-height-threshold 120
          split-width-threshold 160)

    (defun my-split-window-sensibly (&optional window)
        "replacement which splits vertical first"
        (interactive)
        (let ((window (if (boundp 'window)
                              window
                          (selected-window))))
            (if (window-splittable-p window t)
                    (split-window-right)
                (if (window-splittable-p window)
                        (split-window-below)))))
    
    (setq split-window-preferred-function #'my-split-window-sensibly))

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

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:

(progn
    (setq split-height-threshold 120
          split-width-threshold 160)

    (defun my-split-window-sensibly (&optional window)
        "replacement which splits vertical first"
        (interactive)
        (let ((window (if window
                              window
                          (selected-window))))
            (if (window-splittable-p window t)
                    (split-window-right)
                (if (window-splittable-p window)
                        (split-window-below)))))
    
    (setq split-window-preferred-function #'my-split-window-sensibly))

Note: the thresholds need to be twice as big as the smallest window allowed, because the new windows each use half of former window size.
The last line tells emacs to use the defined split function.

Source Link
jue
  • 4.7k
  • 10
  • 21
Loading