Last active
May 11, 2023 08:59
-
-
Save knollet/cb11657d3ecdf894973bd1c3ff7bce23 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 term-git-mode--get-branch () | |
(let ((branches (vc-call-backend 'git 'branches))) | |
(when branches (car branches)))) | |
(define-minor-mode term-git-mode | |
"show current branch in modeline in terminal-modes" | |
:lighter (:eval (let ((git-branch (term-git-mode--get-branch))) | |
(if git-branch | |
(format " git:%s" git-branch) | |
"")))) | |
(add-hook 'term-mode-hook 'term-git-mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment