3

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?

qed
  • 22,298
  • 21
  • 125
  • 196

3 Answers3

6

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)
Dan
  • 5,209
  • 1
  • 25
  • 37
2

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!

qed
  • 22,298
  • 21
  • 125
  • 196
  • 2
    Great, glad it works! I edited the earlier answer to reflect this, and included a suggestion to wrap it in a function rather than a lambda so you could remove it from the hook later if you wanted to. – Dan Jun 10 '14 at 13:44
0

accepted answer did not work for me, but adding

(setq split-height-threshold 0)

to .emacs did