summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/main.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 51a397d4..8e66a8bc 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -165,6 +165,21 @@ With two prefix arguments, write out the day and month name."
 
 ;;; Windows
 
+(defun split-window-properly (&optional window)
+    (let ((window (or window (selected-window))))
+    (or (and (window-splittable-p window)
+	     ;; Split window vertically.
+	     (with-selected-window window
+	       (split-window-below)))
+	(and (window-splittable-p window t)
+	     ;; Split window horizontally.
+	     (with-selected-window window
+	       (split-window-right))))))
+
+(setq split-window-preferred-function #'split-window-properly
+      split-height-threshold nil
+      split-width-threshold 160)
+
 (use-package eyebrowse
   :after (evil)
   :custom ((eyebrowse-new-workspace #'counsel-projectile-switch-project)
@@ -284,6 +299,7 @@ With two prefix arguments, write out the day and month name."
   :custom ((global-magit-file-mode +1)
            (magit-section-visibility-indicator nil)
            (magit-diff-refine-hunk 'all)
+           (magit-display-buffer-function #'display-buffer)
            (magit-completing-read-function #'ivy-completing-read))
   :config (progn
             (remove-hook 'magit-section-highlight-hook 'magit-section-highlight)