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
23 '(powerline-text-scale-factor 0.85)) ;; 100/140
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 100))))
29 ;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 80))))
30 '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100)))))
32 (defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line)))
36 (defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil :inherit mode-line)))
40 (defface powerline-active11 '((t (:background "grey22" :inherit mode-line)))
44 (defface powerline-active22 '((t (:background "grey40" :inherit mode-line)))
48 (defface powerline-inactive11 '((t (:background "grey11" :inherit mode-line)))
52 (defface powerline-inactive22 '((t (:background "grey20" :inherit mode-line)))
57 ;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
58 (defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
62 (defface powerline-active-blue '((t (:background "blue" :inherit mode-line)))
66 ;;;---------------- evil powerline
67 ; https://github.com/raugturi/powerline-evil/blob/master/powerline-evil.el
68 ; ;https://github.com/laynor/emacs-conf/blob/master/packages/sm-package-powerline.el
69 ;(defface powerline-evil-base-face '((t (:foreground "white" :inherit mode-line)))
70 ;(defface powerline-evil-base-face '((t (:foreground "black" :weight bold )))
71 (defface powerline-evil-base-face '((t (:foreground "black" :weight bold :inherit mode-line)))
72 "Base face for powerline evil faces."
75 (defface powerline-evil-normal-face '((t (:background "green" :inherit powerline-evil-base-face)))
76 "Powerline face for evil NORMAL state."
79 (defface powerline-evil-insert-face '((t (:background "blue" :inherit powerline-evil-base-face)))
80 "Powerline face for evil INSERT state."
83 (defface powerline-evil-visual-face '((t (:background "orange" :inherit powerline-evil-base-face)))
84 "Powerline face for evil VISUAL state."
87 (defface powerline-evil-operator-face '((t (:background "cyan" :inherit powerline-evil-base-face)))
88 "Powerline face for evil OPERATOR state."
91 (defface powerline-evil-replace-face '((t (:background "red" :inherit powerline-evil-base-face)))
92 "Powerline face for evil REPLACE state."
95 (defface powerline-evil-motion-face '((t (:background "magenta" :inherit powerline-evil-base-face)))
96 "Powerline face for evil MOTION state."
99 (defface powerline-evil-emacs-face '((t (:background "violet" :inherit powerline-evil-base-face)))
100 "Powerline face for evil EMACS state."
103 (defun powerline-evil-face ()
104 "Function to select appropriate face based on `evil-state'."
105 (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
106 (if (facep face) face nil)))
109 (defun powerline-evil-face (active)
110 (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
111 (cond ((and active (facep face))
113 (active 'powerline-active22)
114 (t 'powerline-inactive22))))
116 (defun powerline-evil-face-22 (active)
117 (if (equal (symbol-name evil-state) "normal")
119 (let ((face (intern (concat "powerline-evil-emacs-face"))))
122 (let ((face (intern (concat "powerline-evil-normal-face"))))
125 ;; (cond ((and active (facep face))
127 ;; (active 'powerline-active22)
128 ;; (t 'powerline-inactive22)))
130 ;;;; (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
131 ;;;; (cond ((and active (facep face))
133 ;;;; (active 'powerline-active22)
134 ;;;; (t 'powerline-inactive22)))
140 (defpowerline powerline-evil-tag
141 (concat " " (replace-regexp-in-string "[<> ]" "" (eval (evil-state-property evil-state :tag))) " "))
148 ;;http://emacser.com/mode-line.htm
149 (defun get-lines-4-mode-line ()
150 (let ((lines (count-lines (point-min) (point-max))))
153 'mouse-face 'mode-line-highlight
154 'face 'mode-line-lines-face
155 'help-echo (format "%d lines" lines)) " ")))
159 (defun powerline-simpler-vc-mode (s)
161 (replace-regexp-in-string "Git:" "" s)
164 (defun powerline-simpler-minor-display (s)
165 (replace-regexp-in-string
167 (mapconcat 'identity '("Undo-Tree" "GitGutter" "Projectile"
168 "Abbrev" "ColorIds" "MRev" "ElDoc" "Paredit"
169 "+1" "+2" "FlyC" "Fly" ;; ":1/0"
170 "Fill" "AC" "FIC") "\\|")) "" s))
172 (defun powerline-format-default-directory (s)
174 (replace-regexp-in-string "/Users/peli3/" "~/" s)
177 (defun powerline-evil-tag-new ()
178 (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ")
181 ;; -----------------------------------------------------------------------------
183 ;; -----------------------------------------------------------------------------
184 ;; |evil| buffer_name | major-mode | vc | | position | pwd | time |
185 ;; -----------------------------------------------------------------------------
188 ;; position and pwd only shows in some mode, such as programming mode
189 ;; using workgroup instead of pwd
190 ;; some other modes such as eshell, package, help, don't need the posittion and
194 ;; -----------------------------------------------------------------------------
196 (defun powerline-ha-theme ()
197 "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
199 (setq-default mode-line-format
204 (powerline-selected-window-active))
206 (if active 'powerline-active00 'powerline-inactive00))
208 (if active 'powerline-active11 'powerline-inactive11))
210 (if active 'powerline-active22 'powerline-inactive22))
212 (if active 'powerline-active-yel 'powerline-inactive22))
214 (if active 'powerline-active-blue 'powerline-inactive22))
215 (pl-evil-face (ignore-errors (powerline-evil-face active)))
217 (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))
220 (if active 'powerline-active-yel 'powerline-inactive22))
223 (format "powerline-%s-%s" powerline-default-separator
224 (car powerline-default-separator-dir))))
227 (format "powerline-%s-%s" powerline-default-separator
228 (cdr powerline-default-separator-dir))))
231 ;; (let ((evil-face (powerline-evil-face)))
233 ;; (powerline-raw (powerline-evil-tag) evil-face)
238 (powerline-raw (powerline-evil-tag) pl-evil-face))
239 ;;; (and evil-mode (funcall separator-left pppp-face face-yel))
240 ;;;;;; (funcall separator-left pppp-face pppp-face)
241 ;;;; (powerline-raw (powerline-evil-tag) pppp-face face-yel)
242 ;; (funcall separator-left (powerline-evil-face) face-yel)
244 (powerline-raw "%*" face-yel 'l)
245 (powerline-buffer-id face-yel 'l)
246 (powerline-raw " " face-yel)
247 (funcall separator-left face-yel face-blue )
248 (powerline-raw " " face-blue)
249 (powerline-major-mode face-blue 'r)
250 (funcall separator-left face-blue mode-line)
251 (powerline-narrow mode-line 'l)
252 ; (powerline-vc mode-line 'r)
253 (powerline-simpler-vc-mode (powerline-vc mode-line 'r))
254 (funcall separator-left mode-line face1)))
255 ; (powerline-simpler-vc-mode (powerline-vc face2))))
259 (funcall separator-right face1 mode-line)
261 (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") mode-line)
262 (funcall separator-right mode-line face-blue)
264 (powerline-raw (concat " [" (powerline-format-default-directory default-directory) "] ") face-blue )
265 (funcall separator-right face-blue face1)
267 (powerline-raw (format-time-string " %m-%d") face1 'r)
268 (funcall separator-right face1 face-yel)
269 (powerline-raw (format-time-string " %I:%M %p %a ") face-yel 'r)))
272 (powerline-raw " " face1)
273 (funcall separator-left face1 face2)
275 (boundp 'erc-modified-channels-object)
276 (powerline-raw erc-modified-channels-object face2 'l))
277 (powerline-major-mode face2 'l)
278 (powerline-process face2)
279 (powerline-raw " :" face2)
281 (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
283 (powerline-raw " " face2)
284 (funcall separator-right face2 face1))))
288 (powerline-render lhs)
289 (powerline-fill face1
290 (powerline-width rhs))
291 (powerline-render rhs))
303 ;;(let ((faces '(mode-line
304 ;; powerline-active00
305 ;; powerline-active11
306 ;; powerline-active22
307 ;; powerline-active-yel
308 ;; powerline-active-blue
309 ;; mode-line-buffer-id
310 ;; mode-line-emphasis
311 ;; mode-line-highlight
312 ;; mode-line-inactive)))
314 ;;; (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10"))
315 ;; (lambda (face) (set-face-attribute face nil :font "Courier"))
320 (provide 'init-color-theme)
325 ;; 1. change color when buffer is modified
327 ;; show date and time in the right below minibuffer