Last active
May 28, 2023 03:43
-
-
Save kaz-utashiro/7aa619794d2e72e96d25a61cf757db2b to your computer and use it in GitHub Desktop.
ウィンドウを分割すると follow-mode にして行番号を表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun activate-follow-mode (&optional window) | |
(follow-mode t) | |
(display-line-numbers-mode t)) | |
(advice-add 'split-window-right :after 'activate-follow-mode) | |
(defun deactivate-follow-mode (&optional window del-all) | |
(when (= 1 (length (window-list))) | |
(follow-mode -1) | |
(display-line-numbers-mode -1))) | |
(dolist (cmd '(delete-window | |
delete-other-windows)) | |
(advice-add cmd :after 'deactivate-follow-mode)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment