diff --git a/init.d/programming/common.el b/init.d/programming/common.el index 52b27a5..5918b2e 100644 --- a/init.d/programming/common.el +++ b/init.d/programming/common.el @@ -1,6 +1,6 @@ ;;; common.el --- Common programming settings. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-01-24T23:17:24+0100> +;; Time-stamp: <2020-01-25T03:46:02+0100> ;;; Commentary: @@ -251,19 +251,6 @@ ;; Git integration. (use-package git-commit :pin melpa - :after (window-purpose) - :defer nil - - :config - (defun my/split-vertically-if-dedicated () - "Split buffers vertically if focused buffer is dedicated to a purpose." - (when (purpose-window-purpose-dedicated-p) - ;; (setq-local split-width-threshold nil) - (setq-local split-height-threshold 40) - )) - - :hook - (git-commit-setup . my/split-vertically-if-dedicated) ) (unless slow-computer @@ -277,12 +264,23 @@ :custom (magit-diff-refine-hunk 'all) ; Show word-granularity differences. + :config + (defun my/split-vertically () + "Split buffers vertically if focused window is dedicated to a +purpose or not wide enough." + (when (or (purpose-window-purpose-dedicated-p) + (< (window-total-width) 160)) + (setq-local split-height-threshold 40) + )) + :bind ("C-x g" . magit-status) ("C-x M-g" . magit-dispatch) :hook (after-save . magit-after-save-refresh-status) + ;; (magit-pre-display-buffer . my/split-vertically) + ;; (git-commit-setup . my/split-vertically) ) ;; Use libgit rather than git.