Fix env versions on mode-line.

This commit is contained in:
Vincent Zhang 2018-07-04 02:15:48 +08:00
parent 28f91fd925
commit 258179ba7a

View file

@ -1009,13 +1009,13 @@ enabled."
;; Versions, support Python, Ruby and Golang ;; Versions, support Python, Ruby and Golang
(add-hook 'python-mode-hook (add-hook 'python-mode-hook
(lambda () (lambda ()
(setq doom-modeline-env-command "python --version 2>&1 | cut -d' ' -f2"))) (setq doom-modeline-env-command "python --version 2>&1 | cut -d' ' -f2 | sed -n '1p'")))
(add-hook 'ruby-mode-hook (add-hook 'ruby-mode-hook
(lambda () (lambda ()
(setq doom-modeline-env-command "ruby --version 2>&1 | cut -d' ' -f2"))) (setq doom-modeline-env-command "ruby --version 2>&1 | cut -d' ' -f2 | sed -n '1p'")))
(add-hook 'go-mode-hook (add-hook 'go-mode-hook
(lambda () (lambda ()
(setq doom-modeline-env-command "go version 2>&1 | cut -d' ' -f3 | tr -d 'go'"))) (setq doom-modeline-env-command "go version 2>&1 | cut -d' ' -f3 | tr -d 'go' | sed -n '1p'")))
;; Ensure modeline is inactive when Emacs is unfocused (and active otherwise) ;; Ensure modeline is inactive when Emacs is unfocused (and active otherwise)