X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig%2Finit-color-theme.el;h=8d72ee7d437b45b38de5ae9b64fda53486eb1b02;hb=e7af859680234fffcca12b24158ab6a47bb7a66d;hp=62508375be1a0b45ea64a331e68531b4ade667fc;hpb=8ec0fef1eb0c7622cc7f2087b88feb0dbc5fbedd;p=dotfiles.git diff --git a/emacs.d/config/init-color-theme.el b/emacs.d/config/init-color-theme.el index 6250837..8d72ee7 100644 --- a/emacs.d/config/init-color-theme.el +++ b/emacs.d/config/init-color-theme.el @@ -12,59 +12,111 @@ (require 'evil) (require 'powerline) -(require 'powerline-evil) +;(require 'powerline-evil) +;(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-text-scale-factor 0.85)) (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 :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))))) -(defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil ))) +(defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line))) "Powerline face 1." :group 'powerline) -(defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil ))) +(defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil :inherit mode-line))) "Powerline face 1." :group 'powerline) -(defface powerline-active11 '((t (:background "grey22" ))) +(defface powerline-active11 '((t (:background "grey22" :inherit mode-line))) "Powerline face 1." :group 'powerline) -(defface powerline-active22 '((t (:background "grey40" ))) +(defface powerline-active22 '((t (:background "grey40" :inherit mode-line))) "Powerline face 2." :group 'powerline) -(defface powerline-inactive11 - '((t (:background "grey11" ))) +(defface powerline-inactive11 '((t (:background "grey11" :inherit mode-line))) "Powerline face 1." :group 'powerline) -(defface powerline-inactive22 - '((t (:background "grey20" ))) +(defface powerline-inactive22 '((t (:background "grey20" :inherit mode-line))) "Powerline face 2." :group 'powerline) +;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line))) +(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line))) + "Powerline face 1." + :group 'powerline) + +(defface powerline-active-blue '((t (:background "blue" :inherit mode-line))) + "Powerline face 1." + :group 'powerline) + +;;;---------------- evil powerline +; https://github.com/raugturi/powerline-evil/blob/master/powerline-evil.el +; ;https://github.com/laynor/emacs-conf/blob/master/packages/sm-package-powerline.el +;(defface powerline-evil-base-face '((t (:foreground "white" :inherit mode-line))) +;(defface powerline-evil-base-face '((t (:foreground "black" :weight bold ))) +(defface powerline-evil-base-face '((t (:foreground "black" :weight bold :inherit mode-line))) + "Base face for powerline evil faces." + :group 'powerline) +(defface powerline-evil-normal-face '((t (:background "green" :inherit powerline-evil-base-face))) + "Powerline face for evil NORMAL state." + :group 'powerline) +(defface powerline-evil-insert-face '((t (:background "blue" :inherit powerline-evil-base-face))) + "Powerline face for evil INSERT state." + :group 'powerline) +(defface powerline-evil-visual-face '((t (:background "orange" :inherit powerline-evil-base-face))) + "Powerline face for evil VISUAL state." + :group 'powerline) -;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line))) -(defface powerline-active-yel '((t (:background "yellow" ))) - "Powerline face 1." +(defface powerline-evil-operator-face '((t (:background "cyan" :inherit powerline-evil-base-face))) + "Powerline face for evil OPERATOR state." :group 'powerline) -(defface powerline-active-blue '((t (:background "blue" ))) - "Powerline face 1." +(defface powerline-evil-replace-face '((t (:background "red" :inherit powerline-evil-base-face))) + "Powerline face for evil REPLACE state." :group 'powerline) +(defface powerline-evil-motion-face '((t (:background "magenta" :inherit powerline-evil-base-face))) + "Powerline face for evil MOTION state." + :group 'powerline) + +(defface powerline-evil-emacs-face '((t (:background "violet" :inherit powerline-evil-base-face))) + "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 (active) + (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))) " ")) + + + ;; @@ -97,6 +149,10 @@ (replace-regexp-in-string "/Users/peli3/" "~/" s) s)) +(defun powerline-evil-tag-new () + (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ") + ) + (defun powerline-ha-theme () "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line." (interactive) @@ -116,6 +172,7 @@ (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))) (separator-left (intern (format "powerline-%s-%s" powerline-default-separator @@ -126,14 +183,16 @@ (cdr powerline-default-separator-dir)))) (lhs (list - (let ((evil-face (powerline-evil-face))) - (if evil-mode -; (progn - (powerline-raw (powerline-evil-tag) evil-face) -;; ) - ) - ) - (funcall separator-left (powerline-evil-face) face-yel) +;; (let ((evil-face (powerline-evil-face))) +;; (if evil-mode +;; (powerline-raw (powerline-evil-tag) evil-face) +;; ) +;; +;; ) + (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)) +;; (funcall separator-left (powerline-evil-face) face-yel) (powerline-raw "%*" face-yel 'l) (powerline-buffer-id face-yel 'l) @@ -191,9 +250,31 @@ (powerline-ha-theme) + + +;;(let ((faces '(mode-line +;; powerline-active00 +;; powerline-active11 +;; powerline-active22 +;; powerline-active-yel +;; powerline-active-blue +;; mode-line-buffer-id +;; mode-line-emphasis +;; mode-line-highlight +;; mode-line-inactive))) +;; (mapc +;;; (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10")) +;; (lambda (face) (set-face-attribute face nil :font "Courier")) +;; faces)) + + + (provide 'init-color-theme) + ;; TODO ;; 1. change color when buffer is modified ;; 2. +;; show date and time in the right below minibuffer +