Skip to content

Instantly share code, notes, and snippets.

(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)
""))))