stardiviner
12/24/2013 - 5:36 AM

init-my-emacs-apperance.el

(setq-default mode-line-format
              '((:propertize "%e"
                             face '(:background "red"))

                ;; mode-line-front-space

                (:propertize " 暗月:> "
                             face '(:background "#121212" :foreground "black")
                             help-echo "九州 - 羽传说 - 向异翅")

                ;; window-number
                ;; '(:eval (window-number-string))
                (:eval (propertize (window-number-string)
                                    'face '(:background "red" :foreground "black")))

                ;; window-numbering

                ;; mode-line-mule-info

                ;; Buffer status
                ;; insert vs overwrite mode, input-method in a tool-tip
                "["
                (:eval (propertize (if overwrite-mode "❯" "✔") ; "Ovr", "Ins"
                                    'face '(:background "dark green")
                                    'help-echo (concat "Buffer is in "
                                                       (if overwrite-mode "overwrite" "insert"))))
                ;; was this buffer modified since the last save?
                ;; TODO add an small pencil ASCII character modification indicator.
                (:eval (when (buffer-modified-p)
                          (concat "," (propertize "☡" ; "Mod"
                                                  'face '(:background "deep pink")
                                                  'help-echo "Buffer has been modified"))))
                ;; is this buffer read-only?
                (:eval (when buffer-read-only
                          (concat "," (propertize "⚑" ; "RO"
                                                  'face '(:background "red")
                                                  'help-echo "Buffer is read-only"))))
                "] "

                ;; VCS - Git, SVN, CVS,
                ;; vc indicator
                (:propertize (vc-mode vc-mode)
                             face '(:background "green"
                                                :weight 'bold
                                                :underline t)
                             help-echo (vc-mode))

                ;; (vc-mode (:eval (propertize vc-mode
                ;;                             'face (pcase (vc-state buffer-file-truename)
                ;;                                     (`up-to-date '(:background "green"))
                ;;                                     (`edited nil)
                ;;                                     (_ '(:background "red"))))))

                ;; (vc-mode (:eval (propertize vc-mode 'face
                ;;   (pcase (vc-state buffer-file-truename)
                ;;     (`up-to-date 'mode-line-important)
                ;;     (`edited                      nil)
                ;;     (_             'mode-line-warning)))))

                ;; the buffer name; the filename as a tool tip
                ;; mode-line-client
                ;; mode-line-remote
                ;; mode-line-frame-identification
                ;; mode-line-buffer-identification
                (:eval (propertize " %b "
                                   'face '(:background "green yellow"
                                                       :family "Averia Serif"
                                                       :height 110
                                                       )
                                   'help-echo (buffer-file-name)))

                ;; line and column number, relative position
                ;; mode-line-position
                ;; '%02' to set to 2 chars at least; prevents flicking
                "("
                (:propertize "%02l") ","
                (:propertize "%02c"
                             ;; face '(if (>= (current-column) 80)
                             ;;           '(:background "red"))
                             )
                ") "

                ;; process
                ;; mode-line-process

                ;; notifications
                ;; ERC
                ;; TODO [#e,i]

                ;; the major mode of the current buffer.
                (:propertize "("
                             face '(:background "orange red"))
                (:eval (propertize "{%m} "
                                    'face '(:background "#6D15D1")
                                    'help-echo buffer-file-coding-system))
                "|"
                ;; list of minor modes
                (:propertize minor-mode-alist
                             face '(:background "dim gray"))
                (:propertize " ) "
                             face '(:background "orange red"))

                ;; add the time, with the date and the emacs uptime in the tool-tip
                ;; (:eval (propertize
                ;;          (format-time-string "%H:%M")
                ;;          'face '(:background "red")
                ;;          'help-echo (concat (format-time-string "%c; ")
                ;;                             (emacs-uptime "Uptime:%hh"))))

                ;; --------------------------- right align ----------------------------------

                ;; relative position, size of file
                " ["
                (:propertize "%p") ;; percent above top window
                "/"
                (:propertize "%I") ;; size
                "] "

                ;; Email

                ;; fill with ' '.
                ;; "% "

                mode-line-end-spaces
                ))

;; mode-line right align (which replace `mode-line-end-spaces' to implement the right alignment.)
(display-time)
(setq global-mode-string (remove 'display-time-string global-mode-string))
(setq mode-line-end-spaces
      (list (propertize " " 'display '(space :align-to (- right 45)))
            ;; you can custom here (add right aligned things here)
            '(:propertize " /我不要这样生,也不要那样死!/ "
                          face '(:background "#222222")
                          help-echo "人的一生是如此的的短暂,而你还有很多的事情,很多的梦想 需要曲实现。\n我不想那样生存,也不想就 这样死去,所以,我要拼命去实现我的想法。")
            'display-time-string
            ))