3 ;(setq display-time-day-and-date t)
7 (setq ns-use-srgb-colorspace nil)
11 (load-theme 'cyberpunk t)
15 ;(require 'powerline-evil)
19 ;(set-face-attribute 'mode-line nil :font "Source Code Pro for Powerline-10")
21 ;;; this variable should equal as height in mode-line
22 ;;;;;(custom-set-variables
23 ;;;;; '(powerline-text-scale-factor 0.85))
26 ;;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :height 0.8 ))))
27 ;;; '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :height 0.8)))))
28 '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 0.8))))
29 '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 0.8)))))
31 (defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line)))
35 (defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil :inherit mode-line)))
39 (defface powerline-active11 '((t (:background "grey22" :inherit mode-line)))
43 (defface powerline-active22 '((t (:background "grey40" :inherit mode-line)))
47 (defface powerline-inactive11 '((t (:background "grey11" :inherit mode-line)))
51 (defface powerline-inactive22 '((t (:background "grey20" :inherit mode-line)))
56 ;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
57 (defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
61 (defface powerline-active-blue '((t (:background "blue" :inherit mode-line)))
65 ;;;---------------- evil powerline
66 ; https://github.com/raugturi/powerline-evil/blob/master/powerline-evil.el
67 ; ;https://github.com/laynor/emacs-conf/blob/master/packages/sm-package-powerline.el
68 ;(defface powerline-evil-base-face '((t (:foreground "white" :inherit mode-line)))
69 ;(defface powerline-evil-base-face '((t (:foreground "black" :weight bold )))
70 (defface powerline-evil-base-face '((t (:foreground "black" :weight bold :inherit mode-line)))
71 "Base face for powerline evil faces."
74 (defface powerline-evil-normal-face '((t (:background "green" :inherit powerline-evil-base-face)))
75 "Powerline face for evil NORMAL state."
78 (defface powerline-evil-insert-face '((t (:background "blue" :inherit powerline-evil-base-face)))
79 "Powerline face for evil INSERT state."
82 (defface powerline-evil-visual-face '((t (:background "orange" :inherit powerline-evil-base-face)))
83 "Powerline face for evil VISUAL state."
86 (defface powerline-evil-operator-face '((t (:background "cyan" :inherit powerline-evil-base-face)))
87 "Powerline face for evil OPERATOR state."
90 (defface powerline-evil-replace-face '((t (:background "red" :inherit powerline-evil-base-face)))
91 "Powerline face for evil REPLACE state."
94 (defface powerline-evil-motion-face '((t (:background "magenta" :inherit powerline-evil-base-face)))
95 "Powerline face for evil MOTION state."
98 (defface powerline-evil-emacs-face '((t (:background "violet" :inherit powerline-evil-base-face)))
99 "Powerline face for evil EMACS state."
102 ;;(defun powerline-evil-face (active)
103 ;; "Function to select appropriate face based on `evil-state'."
104 ;; (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
105 ;; (if (facep face) face nil)))
108 (defun powerline-evil-face (active)
109 (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
110 (cond ((and active (facep face))
112 (active 'powerline-active22)
113 (t 'powerline-inactive22))))
115 (defpowerline powerline-evil-tag
116 (concat " " (replace-regexp-in-string "[<> ]" "" (eval (evil-state-property evil-state :tag))) " "))
123 ;;http://emacser.com/mode-line.htm
124 (defun get-lines-4-mode-line ()
125 (let ((lines (count-lines (point-min) (point-max))))
128 'mouse-face 'mode-line-highlight
129 'face 'mode-line-lines-face
130 'help-echo (format "%d lines" lines)) " ")))
134 (defun powerline-simpler-vc-mode (s)
136 (replace-regexp-in-string "Git:" "" s)
139 (defun powerline-simpler-minor-display (s)
140 (replace-regexp-in-string
142 (mapconcat 'identity '("Undo-Tree" "GitGutter" "Projectile"
143 "Abbrev" "ColorIds" "MRev" "ElDoc" "Paredit"
144 "+1" "+2" "FlyC" "Fly" ;; ":1/0"
145 "Fill" "AC" "FIC") "\\|")) "" s))
147 (defun powerline-format-default-directory (s)
149 (replace-regexp-in-string "/Users/peli3/" "~/" s)
152 (defun powerline-evil-tag-new ()
153 (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ")
156 (defun powerline-ha-theme ()
157 "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
159 (setq-default mode-line-format
164 (powerline-selected-window-active))
166 (if active 'powerline-active00 'powerline-inactive00))
168 (if active 'powerline-active11 'powerline-inactive11))
170 (if active 'powerline-active22 'powerline-inactive22))
172 (if active 'powerline-active-yel 'powerline-inactive22))
174 (if active 'powerline-active-blue 'powerline-inactive22))
175 (pl-evil-face (ignore-errors (powerline-evil-face active)))
178 (format "powerline-%s-%s" powerline-default-separator
179 (car powerline-default-separator-dir))))
182 (format "powerline-%s-%s" powerline-default-separator
183 (cdr powerline-default-separator-dir))))
186 ;; (let ((evil-face (powerline-evil-face)))
188 ;; (powerline-raw (powerline-evil-tag) evil-face)
192 (powerline-raw (powerline-evil-tag) pl-evil-face )
193 (and evil-mode (funcall separator-left pl-evil-face face-yel))
194 ;; (powerline-raw (powerline-evil-tag) (powerline-evil-face))
195 ;; (funcall separator-left (powerline-evil-face) face-yel)
197 (powerline-raw "%*" face-yel 'l)
198 (powerline-buffer-id face-yel 'l)
199 (powerline-raw " " face-yel)
200 (funcall separator-left face-yel face-blue )
201 (powerline-raw " " face-blue)
202 (powerline-major-mode face-blue 'r)
203 (funcall separator-left face-blue mode-line)
204 (powerline-narrow mode-line 'l)
205 ; (powerline-vc mode-line 'r)
206 (powerline-simpler-vc-mode (powerline-vc mode-line 'r))
207 (funcall separator-left mode-line face1)))
208 ; (powerline-simpler-vc-mode (powerline-vc face2))))
212 (funcall separator-right face1 mode-line)
213 (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") mode-line)
214 (funcall separator-right mode-line face-blue)
215 (powerline-raw " [" face-blue)
216 (powerline-raw (powerline-format-default-directory default-directory) face-blue )
217 (powerline-raw "] " face-blue)
218 (funcall separator-right face-blue face1)
219 (powerline-raw (format-time-string " %m-%d") face1 'r)
220 (funcall separator-right face1 face-yel)
221 (powerline-raw (format-time-string " %I:%M %p %a ") face-yel 'r)))
224 (powerline-raw " " face1)
225 (funcall separator-left face1 face2)
227 (boundp 'erc-modified-channels-object)
228 (powerline-raw erc-modified-channels-object face2 'l))
229 (powerline-major-mode face2 'l)
230 (powerline-process face2)
231 (powerline-raw " :" face2)
233 (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
235 (powerline-raw " " face2)
236 (funcall separator-right face2 face1))))
240 (powerline-render lhs)
241 (powerline-fill face1
242 (powerline-width rhs))
243 (powerline-render rhs))
255 ;;(let ((faces '(mode-line
256 ;; powerline-active00
257 ;; powerline-active11
258 ;; powerline-active22
259 ;; powerline-active-yel
260 ;; powerline-active-blue
261 ;; mode-line-buffer-id
262 ;; mode-line-emphasis
263 ;; mode-line-highlight
264 ;; mode-line-inactive)))
266 ;;; (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10"))
267 ;; (lambda (face) (set-face-attribute face nil :font "Courier"))
272 (provide 'init-color-theme)
277 ;; 1. change color when buffer is modified
279 ;; show date and time in the right below minibuffer