feature/evil: recenter after splitting
This commit is contained in:
parent
60cded00e6
commit
b17cafc4f7
1 changed files with 4 additions and 2 deletions
|
@ -143,8 +143,10 @@ across windows."
|
||||||
;; `evil-vsplit-window-right' to non-nil mimics this, but that doesn't update
|
;; `evil-vsplit-window-right' to non-nil mimics this, but that doesn't update
|
||||||
;; window history. That means when you delete a new split, Emacs leaves you on
|
;; window history. That means when you delete a new split, Emacs leaves you on
|
||||||
;; the 2nd to last window on the history stack, which is jarring.
|
;; the 2nd to last window on the history stack, which is jarring.
|
||||||
(defun +evil*window-follow (&rest _) (evil-window-down 1))
|
;;
|
||||||
(defun +evil*window-vfollow (&rest _) (evil-window-right 1))
|
;; Also recenters window on cursor in new split
|
||||||
|
(defun +evil*window-follow (&rest _) (evil-window-down 1) (recenter))
|
||||||
|
(defun +evil*window-vfollow (&rest _) (evil-window-right 1) (recenter))
|
||||||
(advice-add #'evil-window-split :after #'+evil*window-follow)
|
(advice-add #'evil-window-split :after #'+evil*window-follow)
|
||||||
(advice-add #'evil-window-vsplit :after #'+evil*window-vfollow))
|
(advice-add #'evil-window-vsplit :after #'+evil*window-vfollow))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue