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-height 14)
24 '(powerline-text-scale-factor 0.85)) ;; 100/140
27 ;;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :height 0.8 ))))
28 ;;; '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :height 0.8)))))
29 '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 100))))
30 ;; '(mode-line ((t (:foreground "#030303" :background "#bdbdbd" :box nil :family "Source Code Pro for Powerline" :height 80))))
31 '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#666666" :box nil :family "Source Code Pro for Powerline" :height 100)))))
33 (defface powerline-active00 '((t (:foreground "#030303" :background "#bdbdbd" :box nil :inherit mode-line)))
37 (defface powerline-inactive00 '((t (:foreground "#f9f9f9" :background "#666666" :box nil :inherit mode-line)))
41 (defface powerline-active11 '((t (:background "grey22" :inherit mode-line)))
45 (defface powerline-active22 '((t (:background "grey40" :inherit mode-line)))
49 (defface powerline-inactive11 '((t (:background "grey11" :inherit mode-line)))
53 (defface powerline-inactive22 '((t (:background "grey20" :inherit mode-line)))
58 ;(defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
59 (defface powerline-active-yel '((t (:background "yellow" :inherit mode-line)))
63 (defface powerline-active-blue '((t (:background "blue" :inherit mode-line)))
67 ;;;---------------- evil powerline
68 ; https://github.com/raugturi/powerline-evil/blob/master/powerline-evil.el
69 ; ;https://github.com/laynor/emacs-conf/blob/master/packages/sm-package-powerline.el
70 ;(defface powerline-evil-base-face '((t (:foreground "white" :inherit mode-line)))
71 ;(defface powerline-evil-base-face '((t (:foreground "black" :weight bold )))
72 (defface powerline-evil-base-face '((t (:foreground "black" :weight bold :inherit mode-line)))
73 "Base face for powerline evil faces."
76 (defface powerline-evil-normal-face '((t (:background "green" :inherit powerline-evil-base-face)))
77 "Powerline face for evil NORMAL state."
80 (defface powerline-evil-insert-face '((t (:background "blue" :inherit powerline-evil-base-face)))
81 "Powerline face for evil INSERT state."
84 (defface powerline-evil-visual-face '((t (:background "orange" :inherit powerline-evil-base-face)))
85 "Powerline face for evil VISUAL state."
88 (defface powerline-evil-operator-face '((t (:background "cyan" :inherit powerline-evil-base-face)))
89 "Powerline face for evil OPERATOR state."
92 (defface powerline-evil-replace-face '((t (:background "red" :inherit powerline-evil-base-face)))
93 "Powerline face for evil REPLACE state."
96 (defface powerline-evil-motion-face '((t (:background "magenta" :inherit powerline-evil-base-face)))
97 "Powerline face for evil MOTION state."
100 (defface powerline-evil-emacs-face '((t (:background "violet" :inherit powerline-evil-base-face)))
101 "Powerline face for evil EMACS state."
104 (defun powerline-evil-face ()
105 "Function to select appropriate face based on `evil-state'."
106 (let* ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
107 (if (facep face) face nil)))
110 (defun powerline-evil-face (active)
111 (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
112 (cond ((and active (facep face))
114 (active 'powerline-active22)
115 (t 'powerline-inactive22))))
117 (defun powerline-evil-face-22 (active)
118 (if (equal (symbol-name evil-state) "normal")
120 (let ((face (intern (concat "powerline-evil-emacs-face"))))
123 (let ((face (intern (concat "powerline-evil-normal-face"))))
126 ;; (cond ((and active (facep face))
128 ;; (active 'powerline-active22)
129 ;; (t 'powerline-inactive22)))
131 ;;;; (let ((face (intern (concat "powerline-evil-" (symbol-name evil-state) "-face"))))
132 ;;;; (cond ((and active (facep face))
134 ;;;; (active 'powerline-active22)
135 ;;;; (t 'powerline-inactive22)))
141 (defpowerline powerline-evil-tag
142 (concat " " (replace-regexp-in-string "[<> ]" "" (eval (evil-state-property evil-state :tag))) " "))
149 ;;http://emacser.com/mode-line.htm
150 (defun get-lines-4-mode-line ()
151 (let ((lines (count-lines (point-min) (point-max))))
154 'mouse-face 'mode-line-highlight
155 'face 'mode-line-lines-face
156 'help-echo (format "%d lines" lines)) " ")))
160 (defun powerline-simpler-vc-mode (s)
162 (replace-regexp-in-string "Git:" "" s)
165 (defun powerline-simpler-minor-display (s)
166 (replace-regexp-in-string
168 (mapconcat 'identity '("Undo-Tree" "GitGutter" "Projectile"
169 "Abbrev" "ColorIds" "MRev" "ElDoc" "Paredit"
170 "+1" "+2" "FlyC" "Fly" ;; ":1/0"
171 "Fill" "AC" "FIC") "\\|")) "" s))
173 (defun powerline-format-default-directory (s)
175 (replace-regexp-in-string "/Users/peli3/" "~/" s)
178 (defun powerline-evil-tag-new ()
179 (concat (replace-regexp-in-string "[<>]" "" (powerline-evil-tag)) " ")
182 ;; -----------------------------------------------------------------------------
184 ;; -----------------------------------------------------------------------------
185 ;; |evil| buffer_name | major-mode | vc | | position | pwd | time |
186 ;; -----------------------------------------------------------------------------
189 ;; position and pwd only shows in some mode, such as programming mode
190 ;; using workgroup instead of pwd
191 ;; some other modes such as eshell, package, help, don't need the posittion and
195 ;; -----------------------------------------------------------------------------
197 (defun powerline-ha-theme ()
198 "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line."
200 (setq-default mode-line-format
205 (powerline-selected-window-active))
207 (if active 'powerline-active00 'powerline-inactive00))
209 (if active 'powerline-active11 'powerline-inactive11))
211 (if active 'powerline-active22 'powerline-inactive22))
213 (if active 'powerline-active-yel 'powerline-inactive22))
215 (if active 'powerline-active-blue 'powerline-inactive22))
216 (pl-evil-face (ignore-errors (powerline-evil-face active)))
218 (intern (concat "powerline-evil-" (symbol-name evil-state) "-face")))
221 (if active 'powerline-active-yel 'powerline-inactive22))
224 (format "powerline-%s-%s" powerline-default-separator
225 (car powerline-default-separator-dir))))
228 (format "powerline-%s-%s" powerline-default-separator
229 (cdr powerline-default-separator-dir))))
232 ;; (let ((evil-face (powerline-evil-face)))
234 ;; (powerline-raw (powerline-evil-tag) evil-face)
239 (powerline-raw (powerline-evil-tag) pl-evil-face))
240 ;;; (and evil-mode (funcall separator-left pppp-face face-yel))
241 ;;;;;; (funcall separator-left pppp-face pppp-face)
242 ;;;; (powerline-raw (powerline-evil-tag) pppp-face face-yel)
243 ;; (funcall separator-left (powerline-evil-face) face-yel)
245 (powerline-raw "%*" face-yel 'l)
246 (powerline-buffer-id face-yel 'l)
247 (powerline-raw " " face-yel)
248 (funcall separator-left face-yel face-blue )
249 (powerline-raw " " face-blue)
250 (powerline-major-mode face-blue 'r)
251 (funcall separator-left face-blue mode-line)
252 (powerline-narrow mode-line 'l)
253 ; (powerline-vc mode-line 'r)
254 (powerline-simpler-vc-mode (powerline-vc mode-line 'r))
255 (funcall separator-left mode-line face1)))
256 ; (powerline-simpler-vc-mode (powerline-vc face2))))
260 (funcall separator-right face1 mode-line)
262 ;; (powerline-raw (concat " [" (powerline-format-default-directory default-directory) "] ") mode-line)
263 (powerline-raw (format " P:[%s] " (projectile-project-name)) mode-line)
264 (funcall separator-right mode-line face-blue)
266 (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") face-blue)
267 ; (funcall separator-right face-blue face1)
269 ;;; (powerline-raw (format-time-string " %m-%d") face1 'r)
270 (funcall separator-right face-blue face-yel)
271 (powerline-raw (format-time-string " %I:%M %p %m-%d %a ") face-yel 'r)))
274 (powerline-raw " " face1)
275 (funcall separator-left face1 face2)
277 (boundp 'erc-modified-channels-object)
278 (powerline-raw erc-modified-channels-object face2 'l))
279 (powerline-major-mode face2 'l)
280 (powerline-process face2)
281 (powerline-raw " :" face2)
283 (powerline-simpler-minor-display (powerline-minor-modes face2 'l))
285 (powerline-raw " " face2)
286 (funcall separator-right face2 face1))))
290 (powerline-render lhs)
291 (powerline-fill face1
292 (powerline-width rhs))
293 (powerline-render rhs))
305 ;;(let ((faces '(mode-line
306 ;; powerline-active00
307 ;; powerline-active11
308 ;; powerline-active22
309 ;; powerline-active-yel
310 ;; powerline-active-blue
311 ;; mode-line-buffer-id
312 ;; mode-line-emphasis
313 ;; mode-line-highlight
314 ;; mode-line-inactive)))
316 ;;; (lambda (face) (set-face-attribute face nil :font "Source Code Pro for Powerline-10"))
317 ;; (lambda (face) (set-face-attribute face nil :font "Courier"))
322 (provide 'init-color-theme)
327 ;; 1. change color when buffer is modified
329 ;; show date and time in the right below minibuffer