From a7643cf9186fb5b713ca7d6bfa3b6d440d687cf3 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 22 Nov 2018 03:59:39 +0800 Subject: [PATCH] Add an indicator of remote host. --- doom-modeline.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doom-modeline.el b/doom-modeline.el index f31fddd..a1a6c7f 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1206,12 +1206,23 @@ See `mode-line-percent-position'.") " ")))) +;; +;; remote host +;; + +(doom-modeline-def-segment remote-host + "Hostname for remote buffers." + (when default-directory + (when-let ((host (file-remote-p default-directory 'host))) + (concat "@" host)))) + + ;; ;; Mode lines ;; (doom-modeline-def-modeline 'main - '(bar workspace-number window-number evil-state god-state ryo-modal-state matches " " buffer-info buffer-position " " selection-info) + '(bar workspace-number window-number evil-state god-state ryo-modal-state matches " " buffer-info remote-host buffer-position " " selection-info) '(global input-method buffer-encoding major-mode process vcs flycheck)) (doom-modeline-def-modeline 'minimal