[Feature] options: doom-modeline-buffer-encoding and doom-modeline-indent-info.

This commit is contained in:
Vincent Zhang 2019-05-14 02:11:40 +08:00
parent edd97bb2a0
commit 356e8d670a
2 changed files with 26 additions and 18 deletions

View file

@ -149,6 +149,12 @@ Given ~/Projects/FOSS/emacs/lisp/comint.el
(defvar doom-modeline-major-mode-color-icon t
"Whether display color icons for `major-mode'. It respects `doom-modeline-icon' and `all-the-icons-color-icons'.")
(defvar doom-modeline-buffer-encoding t
"Whether display buffer encoding.")
(defvar doom-modeline-indent-info nil
"Whether display indentation information.")
(defvar doom-modeline-buffer-state-icon t
"Whether display icons for buffer states. It respects `doom-modeline-icon'.")

View file

@ -419,6 +419,7 @@ directory, the file name, and its state (modified, read-only or non-existent)."
(doom-modeline-def-segment buffer-encoding
"Displays the encoding and eol style of the buffer the same way Atom does."
(when doom-modeline-buffer-encoding
(propertize
(concat (pcase (coding-system-eol-type buffer-file-coding-system)
(0 " LF")
@ -433,7 +434,7 @@ directory, the file name, and its state (modified, read-only or non-existent)."
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)
'help-echo 'mode-line-mule-info-help-echo
'mouse-face '(:box 0)
'local-map mode-line-coding-system-map))
'local-map mode-line-coding-system-map)))
;;
@ -442,9 +443,10 @@ directory, the file name, and its state (modified, read-only or non-existent)."
(doom-modeline-def-segment indent-info
"Displays the indentation information."
(when doom-modeline-indent-info
(propertize (format " %s %d "
(if indent-tabs-mode "TAB" "SPC") tab-width)
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)))
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive))))
;;
;; remote host