From e627bef53a672690b0487333b0ce4a0c1cd94225 Mon Sep 17 00:00:00 2001 From: Marcus Kammer <2262664-marcuskammer@users.noreply.gitlab.com> Date: Mon, 10 Aug 2020 19:41:50 +0200 Subject: [PATCH] Add a second function to split windows vertical --- init.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 54e3c826..af9e1bdc 100755 --- a/init.el +++ b/init.el @@ -31,7 +31,7 @@ (load "bundle--mk") (defun me/split-windows-horizontal () - ; Split windows horizontal by equal width + "Split windows horizontal by equal width" (interactive) (setq count-windows 3) (delete-other-windows) @@ -42,3 +42,14 @@ (setq count (1+ count))))) (me/split-windows-horizontal) + +(defun me/split-windows-vertical () + "Split windows vertical by equal height" + (interactive) + (setq count-windows 3) + (delete-other-windows) + (let ((height (/ (window-total-height) count-windows))) + (setq count 0) + (while (< count (1- count-windows)) + (split-window-below (- 0 height)) + (setq count (1+ count)))))