aboutsummaryrefslogtreecommitdiff
path: root/bard-elisp/bard-window.el
diff options
context:
space:
mode:
Diffstat (limited to 'bard-elisp/bard-window.el')
-rw-r--r--bard-elisp/bard-window.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/bard-elisp/bard-window.el b/bard-elisp/bard-window.el
index 1670312..274f583 100644
--- a/bard-elisp/bard-window.el
+++ b/bard-elisp/bard-window.el
@@ -144,4 +144,15 @@ This as the action function in a `display-buffer-alist' entry."
(rx (or "*" "helpful" "Org Src"))
"" name)))
+(defun bard/toggle-window-split ()
+ "Toggle between horizontal and vertical window splits."
+ (interactive)
+ (let ((split-direction (if (= (window-width) (frame-width))
+ 'vertical
+ 'horizontal)))
+ (delete-other-windows)
+ (if (eq split-direction 'horizontal)
+ (split-window-vertically)
+ (split-window-horizontally))))
+
(provide 'bard-window)