Update format.

This commit is contained in:
Vincent Zhang 2018-06-19 14:11:39 +08:00
parent b66b92c6fc
commit 2d9ce25bcc

View file

@ -577,50 +577,50 @@ Example:
;; ;;
(doom-modeline-def-segment! buffer-default-directory (doom-modeline-def-segment! buffer-default-directory
"Displays `default-directory'. This is for special buffers like the scratch "Displays `default-directory'. This is for special buffers like the scratch
buffer where knowing the current project directory is important." buffer where knowing the current project directory is important."
(let ((face (if (doom-modeline--active) 'doom-modeline-buffer-path))) (let ((face (if (doom-modeline--active) 'doom-modeline-buffer-path)))
(concat (if (display-graphic-p) " ") (concat (if (display-graphic-p) " ")
(doom-modeline-maybe-icon-octicon (doom-modeline-maybe-icon-octicon
"file-directory" "file-directory"
:face face :face face
:v-adjust -0.05 :v-adjust -0.05
:height 1.25) :height 1.25)
(propertize (concat " " (abbreviate-file-name default-directory)) (propertize (concat " " (abbreviate-file-name default-directory))
'face face)))) 'face face))))
;; ;;
(doom-modeline-def-segment! buffer-info (doom-modeline-def-segment! buffer-info
"Combined information about the current buffer, including the current working "Combined information about the current buffer, including the current working
directory, the file name, and its state (modified, read-only or non-existent)." directory, the file name, and its state (modified, read-only or non-existent)."
(concat (cond (buffer-read-only (concat (cond (buffer-read-only
(concat (doom-modeline-maybe-icon-octicon (concat (doom-modeline-maybe-icon-octicon
"lock" "lock"
:face 'doom-modeline-warning :face 'doom-modeline-warning
:v-adjust -0.05) :v-adjust -0.05)
" ")) " "))
((buffer-modified-p) ((buffer-modified-p)
(concat (doom-modeline-maybe-icon-faicon (concat (doom-modeline-maybe-icon-faicon
"floppy-o" "floppy-o"
:face 'doom-modeline-buffer-modified :face 'doom-modeline-buffer-modified
:v-adjust -0.0575) :v-adjust -0.0575)
" ")) " "))
((and buffer-file-name ((and buffer-file-name
(not (file-exists-p buffer-file-name))) (not (file-exists-p buffer-file-name)))
(concat (doom-modeline-maybe-icon-octicon (concat (doom-modeline-maybe-icon-octicon
"circle-slash" "circle-slash"
:face 'doom-modeline-urgent :face 'doom-modeline-urgent
:v-adjust -0.05) :v-adjust -0.05)
" ")) " "))
((buffer-narrowed-p) ((buffer-narrowed-p)
(concat (doom-modeline-maybe-icon-octicon (concat (doom-modeline-maybe-icon-octicon
"fold" "fold"
:face 'doom-modeline-warning :face 'doom-modeline-warning
:v-adjust -0.05) :v-adjust -0.05)
" "))) " ")))
(if buffer-file-name (if buffer-file-name
(doom-modeline-buffer-file-name) (doom-modeline-buffer-file-name)
"%b"))) "%b")))
(doom-modeline-def-segment! buffer-info-simple (doom-modeline-def-segment! buffer-info-simple
"Display only the current buffer's name, but with fontification." "Display only the current buffer's name, but with fontification."
@ -965,12 +965,12 @@ enabled."
(buffer-encoding major-mode flycheck)) (buffer-encoding major-mode flycheck))
(doom-modeline-def-modeline! project (doom-modeline-def-modeline! project
(bar buffer-default-directory) (bar buffer-default-directory)
(major-mode)) (major-mode))
(doom-modeline-def-modeline! media (doom-modeline-def-modeline! media
(bar " %b ") (bar " %b ")
(media-info major-mode)) (media-info major-mode))
;; ;;
;; Hooks ;; Hooks