[Feature] indent-info segment.

This commit is contained in:
Vincent Zhang 2019-05-14 01:59:51 +08:00
parent 23c9278704
commit edd97bb2a0
2 changed files with 16 additions and 2 deletions

View file

@ -412,7 +412,11 @@ directory, the file name, and its state (modified, read-only or non-existent)."
((doom-modeline--active) 'doom-modeline-buffer-file)
(t 'mode-line-inactive))))
;;
;; encoding
;;
(doom-modeline-def-segment buffer-encoding
"Displays the encoding and eol style of the buffer the same way Atom does."
(propertize
@ -432,6 +436,16 @@ directory, the file name, and its state (modified, read-only or non-existent)."
'local-map mode-line-coding-system-map))
;;
;; indentation
;;
(doom-modeline-def-segment indent-info
"Displays the indentation information."
(propertize (format " %s %d "
(if indent-tabs-mode "TAB" "SPC") tab-width)
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)))
;;
;; remote host
;;

View file

@ -87,7 +87,7 @@
(doom-modeline-def-modeline 'main
'(bar workspace-name window-number modals matches buffer-info remote-host buffer-position parrot selection-info)
'(objed-state misc-info persp-name fancy-battery irc mu4e github debug lsp minor-modes input-method buffer-encoding major-mode process vcs checker))
'(objed-state misc-info persp-name fancy-battery irc mu4e github debug lsp minor-modes input-method indent-info buffer-encoding major-mode process vcs checker))
(doom-modeline-def-modeline 'minimal
'(bar matches " " buffer-info)
@ -95,7 +95,7 @@
(doom-modeline-def-modeline 'special
'(bar window-number modals matches buffer-info-simple buffer-position parrot selection-info)
'(objed-state misc-info fancy-battery irc-buffers debug lsp minor-modes input-method buffer-encoding major-mode process checker))
'(objed-state misc-info fancy-battery irc-buffers debug lsp minor-modes input-method indent-info buffer-encoding major-mode process checker))
(doom-modeline-def-modeline 'project
'(bar window-number " " buffer-default-directory)