X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig%2Finit-color-theme.el;h=431685c7c51f5c1838435f0974a9f02a8ecb6900;hb=5a3379d15ebdb5f7e2d96199841f0d07e2efeacc;hp=8d72ee7d437b45b38de5ae9b64fda53486eb1b02;hpb=e7af859680234fffcca12b24158ab6a47bb7a66d;p=dotfiles.git diff --git a/emacs.d/config/init-color-theme.el b/emacs.d/config/init-color-theme.el index 8d72ee7..431685c 100644 --- a/emacs.d/config/init-color-theme.el +++ b/emacs.d/config/init-color-theme.el @@ -19,14 +19,16 @@ ;(set-face-attribute 'mode-line nil :font "Source Code Pro for Powerline-10") ;;; this variable should equal as height in mode-line -;;;;;(custom-set-variables -;;;;; '(powerline-text-scale-factor 0.85)) +(custom-set-variables + '(powerline-height 14) + '(powerline-text-scale-factor 0.85)) ;; 100/140 (custom-set-faces ;;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :height 0.8 )))) ;;; '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :height 0.8))))) - '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 0.8)))) - '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 0.8))))) + '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 100)))) +;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 80)))) + '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100))))) (defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line))) "Powerline face 1." @@ -99,11 +101,11 @@ "Powerline face for evil EMACS state." :group 'powerline) -;;(defun powerline-evil-face (active) -;; "Function to select appropriate face based on `evil-state'." -;; (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))) -;; (if (facep face) face nil))) -;; +(defun powerline-evil-face () + "Function to select appropriate face based on `evil-state'." + (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))) + (if (facep face) face nil))) + (defun powerline-evil-face (active) (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))) @@ -112,6 +114,30 @@ (active 'powerline-active22) (t 'powerline-inactive22)))) + (defun powerline-evil-face-22 (active) + (if (equal (symbol-name evil-state) "normal") + + (let ((face (intern (concat "powerline-evil-emacs-face")))) + face) + + (let ((face (intern (concat "powerline-evil-normal-face")))) + face) + +;; (cond ((and active (facep face)) +;; face) +;; (active 'powerline-active22) +;; (t 'powerline-inactive22))) + +;;;; (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))) +;;;; (cond ((and active (facep face)) +;;;; face) +;;;; (active 'powerline-active22) +;;;; (t 'powerline-inactive22))) + ) + ) + + + (defpowerline powerline-evil-tag (concat " " (replace-regexp-in-string "[<> ]" "" (eval (evil-state-property evil-state :tag))) " ")) @@ -153,6 +179,21 @@ (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ") ) +;; ----------------------------------------------------------------------------- + +;; ----------------------------------------------------------------------------- +;; |evil| buffer_name | major-mode | vc | | position | pwd | time | +;; ----------------------------------------------------------------------------- +;; +;; ToDo: +;; position and pwd only shows in some mode, such as programming mode +;; using workgroup instead of pwd +;; some other modes such as eshell, package, help, don't need the posittion and +;; pwd +;; + +;; ----------------------------------------------------------------------------- + (defun powerline-ha-theme () "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line." (interactive) @@ -172,7 +213,12 @@ (if active 'powerline-active-yel 'powerline-inactive22)) (face-blue (if active 'powerline-active-blue 'powerline-inactive22)) - (pl-evil-face (ignore-errors (powerline-evil-face active))) + (pl-evil-face (ignore-errors (powerline-evil-face active))) + (pppp-face + (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))) + + (face-yel22 + (if active 'powerline-active-yel 'powerline-inactive22)) (separator-left (intern (format "powerline-%s-%s" powerline-default-separator @@ -189,9 +235,11 @@ ;; ) ;; ;; ) - (powerline-raw (powerline-evil-tag) pl-evil-face ) - (and evil-mode (funcall separator-left pl-evil-face face-yel)) -;; (powerline-raw (powerline-evil-tag) (powerline-evil-face)) + (if evil-mode + (powerline-raw (powerline-evil-tag) pl-evil-face)) +;;; (and evil-mode (funcall separator-left pppp-face face-yel)) +;;;;;; (funcall separator-left pppp-face pppp-face) +;;;; (powerline-raw (powerline-evil-tag) pppp-face face-yel) ;; (funcall separator-left (powerline-evil-face) face-yel) (powerline-raw "%*" face-yel 'l) @@ -210,14 +258,16 @@ (rhs (list (funcall separator-right face1 mode-line) - (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") mode-line) + ;; position +;; (powerline-raw (concat " [" (powerline-format-default-directory default-directory) "] ") mode-line) + (powerline-raw (format " P:[%s] " (projectile-project-name)) mode-line) (funcall separator-right mode-line face-blue) - (powerline-raw " [" face-blue) - (powerline-raw (powerline-format-default-directory default-directory) face-blue ) - (powerline-raw "] " face-blue) - (funcall separator-right face-blue face1) - (powerline-raw (format-time-string " %m-%d") face1 'r) - (funcall separator-right face1 face-yel) + ;; pwd/workgroups + (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") face-blue) +; (funcall separator-right face-blue face1) + ;; date and time +;;; (powerline-raw (format-time-string " %m-%d") face1 'r) + (funcall separator-right face-blue face-yel) (powerline-raw (format-time-string " %I:%M %p %a ") face-yel 'r))) (center (list