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.74)) ;; 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 (defun powerline-ha-theme ()
182 "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
184 (setq-default mode-line-format
189 (powerline-selected-window-active))
191 (if active 'powerline-active00 'powerline-inactive00))
193 (if active 'powerline-active11 'powerline-inactive11))
195 (if active 'powerline-active22 'powerline-inactive22))
197 (if active 'powerline-active-yel 'powerline-inactive22))
199 (if active 'powerline-active-blue 'powerline-inactive22))
200 (pl-evil-face (ignore-errors (powerline-evil-face active)))
202 (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))
205 (if active 'powerline-active-yel 'powerline-inactive22))
208 (format "powerline-%s-%s" powerline-default-separator
209 (car powerline-default-separator-dir))))
212 (format "powerline-%s-%s" powerline-default-separator
213 (cdr powerline-default-separator-dir))))
216 ;; (let ((evil-face (powerline-evil-face)))
218 ;; (powerline-raw (powerline-evil-tag) evil-face)
222 (powerline-raw (powerline-evil-tag) pl-evil-face)
223 ;;; (and evil-mode (funcall separator-left pppp-face face-yel))
224 ;;;;;; (funcall separator-left pppp-face pppp-face)
225 ;;;; (powerline-raw (powerline-evil-tag) pppp-face face-yel)
226 ;; (funcall separator-left (powerline-evil-face) face-yel)
228 (powerline-raw "%*" face-yel 'l)
229 (powerline-buffer-id face-yel 'l)
230 (powerline-raw " " face-yel)
231 (funcall separator-left face-yel face-blue )
232 (powerline-raw " " face-blue)
233 (powerline-major-mode face-blue 'r)
234 (funcall separator-left face-blue mode-line)
235 (powerline-narrow mode-line 'l)
236 ; (powerline-vc mode-line 'r)
237 (powerline-simpler-vc-mode (powerline-vc mode-line 'r))
238 (funcall separator-left mode-line face1)))
239 ; (powerline-simpler-vc-mode (powerline-vc face2))))
243 (funcall separator-right face1 mode-line)
244 (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") mode-line)
245 (funcall separator-right mode-line face-blue)
246 (powerline-raw " [" face-blue)
247 (powerline-raw (powerline-format-default-directory default-directory) face-blue )
248 (powerline-raw "] " face-blue)
249 (funcall separator-right face-blue face1)
250 (powerline-raw (format-time-string " %m-%d") face1 'r)
251 (funcall separator-right face1 face-yel)
252 (powerline-raw (format-time-string " %I:%M %p %a ") face-yel 'r)))
255 (powerline-raw " " face1)
256 (funcall separator-left face1 face2)
258 (boundp 'erc-modified-channels-object)
259 (powerline-raw erc-modified-channels-object face2 'l))
260 (powerline-major-mode face2 'l)
261 (powerline-process face2)
262 (powerline-raw " :" face2)
264 (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
266 (powerline-raw " " face2)
267 (funcall separator-right face2 face1))))
271 (powerline-render lhs)
272 (powerline-fill face1
273 (powerline-width rhs))
274 (powerline-render rhs))
286 ;;(let ((faces '(mode-line
287 ;; powerline-active00
288 ;; powerline-active11
289 ;; powerline-active22
290 ;; powerline-active-yel
291 ;; powerline-active-blue
292 ;; mode-line-buffer-id
293 ;; mode-line-emphasis
294 ;; mode-line-highlight
295 ;; mode-line-inactive)))
297 ;;; (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10"))
298 ;; (lambda (face) (set-face-attribute face nil :font "Courier"))
303 (provide 'init-color-theme)
308 ;; 1. change color when buffer is modified
310 ;; show date and time in the right below minibuffer