I always prefer horizontally splitting because the screen has more horizontal space. In python-mode I can achieve this by setting
(py-split-windows-on-execute-function (quote split-window-horizontally))
Is there something similar in ESS mode?
I don't know if ESS has anything mode-specific. From the help pages, however, it looks like split-window-preferred-function
defaults to split-window-sensibly
, which in turn determines how to split a window based on split-width-threshold
and split-height-threshold
. Setting the former to nil
forbids a horizontal split, and the latter to nil
forbids a vertical split. These settings would be global; you could put (setq-local split-height-threshold nil)
in your ess-mode-hook
.
Edited/extended to reflect @qed's answer. You might consider packaging the local bindings in a function rather than in a lambda to give yourself the option of removing the function from the hook.
(defun forbid-vertical-split ()
"Only permit horizontal window splits."
(setq-local split-height-threshold nil)
(setq-local split-width-threshold 0))
(require 'ess-site)
(add-hook 'ess-mode-hook
'forbid-vertical-split)
This seems to do the trick:
(require 'ess-site)
(add-hook 'ess-mode-hook
(lambda()
(setq-local split-height-threshold nil)
(setq-local split-width-threshold 0)
))
Kudos to Dan!
accepted answer did not work for me, but adding
(setq split-height-threshold 0)
to .emacs did