mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
Fix errors for env versions in mode-line.
This commit is contained in:
parent
258179ba7a
commit
926a83360c
1 changed files with 6 additions and 3 deletions
|
@ -1009,13 +1009,16 @@ enabled."
|
|||
;; Versions, support Python, Ruby and Golang
|
||||
(add-hook 'python-mode-hook
|
||||
(lambda ()
|
||||
(setq doom-modeline-env-command "python --version 2>&1 | cut -d' ' -f2 | sed -n '1p'")))
|
||||
(when (executable-find "python")
|
||||
(setq doom-modeline-env-command "python --version 2>&1 | cut -d' ' -f2 | sed -n '1p'"))))
|
||||
(add-hook 'ruby-mode-hook
|
||||
(lambda ()
|
||||
(setq doom-modeline-env-command "ruby --version 2>&1 | cut -d' ' -f2 | sed -n '1p'")))
|
||||
(when (executable-find "ruby")
|
||||
(setq doom-modeline-env-command "ruby --version 2>&1 | cut -d' ' -f2 | sed -n '1p'"))))
|
||||
(add-hook 'go-mode-hook
|
||||
(lambda ()
|
||||
(setq doom-modeline-env-command "go version 2>&1 | cut -d' ' -f3 | tr -d 'go' | sed -n '1p'")))
|
||||
(when (executable-find "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)
|
||||
|
|
Loading…
Reference in a new issue